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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,29ffcfebbad909d0 X-Google-Attributes: gid103376,public From: "K. E. Garlington" Subject: Re: Two more AQS-95 questions Date: 1998/02/05 Message-ID: <34D9DF1F.33B8@nospam.lmco.com>#1/1 X-Deja-AN: 322335359 Content-Transfer-Encoding: 7bit References: <34D60055.1FFF@gc057.fw.hac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Lockheed Martin Tactical Aircraft Systems (LMTAS) Newsgroups: comp.lang.ada Date: 1998-02-05T00:00:00+00:00 List-Id: Wes Groleau wrote: > > 1) In 3.2.6, why "use a constant ... when the value must be static" > but "named numbers, ... whenever possible." Isn't a named number > static? Is there an advantage to a (typed) constant for > "staticness" ? Just for the record, the rationale given for using a named number instead of a constant is: "Named numbers allow compilers to generate more efficient code than for constants and to perform more complete error checking at compile time." I've seen the efficiency effect sporadically (not enough to use it as justification in this case); how the error checking advantage accrues is beyond me. I wonder if this is just a misinterpretation of another rule in the set; that it's sometimes better to write a constant declaration in terms of an equation of named numbers rather than a single literal?