From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2a687662f09731bb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: Ada Quality and Style book discussion Date: Wed, 16 Nov 2005 07:03:51 +0000 (UTC) Organization: BT Openworld Message-ID: References: NNTP-Posting-Host: host86-131-211-80.range86-131.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com 1132124631 16597 86.131.211.80 (16 Nov 2005 07:03:51 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Wed, 16 Nov 2005 07:03:51 +0000 (UTC) In-Reply-To: X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) Xref: g2news1.google.com comp.lang.ada:6419 Date: 2005-11-16T07:03:51+00:00 List-Id: Simon Wright wrote: > Anonymous Coward writes: > > >>I also object to the guides comment advising against "Day_Type". >>It's a very good practice to suffix types with "_Type", "_Record", >>or "_Array", so it's clear from the identifier what it refers to, >>and also so you don't hijack a good variable name. In the above >>case, "Day" can no longer be used to name an object. > > > This is one of the more contentious style arguments. If you work on my > project, I will insist that you _don't_ stick these useless suffices > on. And I'm not sure that Day is a good variable name; if it's not > worth giving it a name which indicates its use, what's wrong with > plain D? (we were tempted to have a local style guideline that the > length of a name should be log2(lines of scope)). I'm with Simon on this one. "Today" or "This_Day" or "The_First_Day" are better variable names... ...however, there are times when there are name clashes and (for no good reason that I can think of) Ada can't tell the difference between a types name and, say, an enumerate. So, instead of appending the ugly "_Type", I prefer to use the English as my inspiration and prefix "A_" or "An_". Types are after all "indefinite articles". Objects are "definite articles". E.g. My_New_Saab : A_Car; Which can be read "My new Saab is a Car". Cheers -- Martin