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-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Ada Recursion with strings Date: Fri, 03 Oct 2008 09:38:01 +0200 Organization: Adalog Message-ID: References: <2fJEk.367687$yE1.299201@attbi_s21> <758a1a91-7521-4ad3-9af0-a79d434ae60e@v28g2000hsv.googlegroups.com> <6e76ea5c-8bca-4c22-b561-87d2039d8924@m36g2000hse.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1223015437 9296 195.25.228.57 (3 Oct 2008 06:30:37 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 3 Oct 2008 06:30:37 +0000 (UTC) User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) In-Reply-To: <6e76ea5c-8bca-4c22-b561-87d2039d8924@m36g2000hse.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:7932 Date: 2008-10-03T09:38:01+02:00 List-Id: Maciej Sobczak a �crit : > Buffer_Size := Get_Buffer_Size_In_Bytes; > Buffer_Bits := Buffer_Size * 8; > > Is there any benefit from making the above more verbose with > additional named constant? > Or would it be confusing to anyone to see literal 8 (or some formula > that is build around it) in representation clause? I don't think so. Agreed. An even more convincing case of where you should *not* use named constants is X**2. An abuse of the rule "don't use literals" could not produce anything but X**Two, which is in no way better... The rule should be: if the number has a logical meaning give it a name (i.e. if there are 4 people in a car, call it People_In_Car, not 4). But if it is a 2, and cannot change under any condition, by all means, call it "2" ! (and yes, with AdaControl, you can specify exceptions to the rule that forbids literals, like as exponent for example). -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr