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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8d472879e3f609e0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-04 13:00:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed.stueberl.de!news2.euro.net!news2.euro.net!uunet!ash.uu.net!spool0902.news.uu.net!not-for-mail Date: Wed, 04 Jun 2003 16:00:24 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Case sensitivity (was Re: no title) References: <1054647054.761122@master.nyc.kbcfp.com> <1054651042.211055@master.nyc.kbcfp.com> <0egDa.45243$fT5.9340@nwrdny01.gnilink.net> <82347202.0306040546.34773e3@posting.google.com> <1054736576.85233@master.nyc.kbcfp.com> <82347202.0306041126.7e9b0e97@posting.google.com> In-Reply-To: <82347202.0306041126.7e9b0e97@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1054756824.267420@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1054756827 13758 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:38639 Date: 2003-06-04T16:00:24-04:00 List-Id: Jim Rogers wrote: > In an Ada program I would expect values corresponding to an > acronym to be defined as enumeration values. Variables should > not be named after an acronym. Acronyms have a constant value. > Variables have variable values. Acronyms map more correctly to > enumeration values in Ada and C++, or constants in either language, > than to variables. If my Iraq-bound bomber has a single very large explosive device on it, I don't see any reason why the type describing that device shouldn't be called 'MOAB' and why its single instance object shouldn't be called 'moab'. If I'm serializing some objects to a file, I don't see why I shouldn't do enum { SNAP, CRACKLE, POP }; void serialize(stream &o, const Snap &v) { o << SNAP << v; } void serialize(stream &o, const Crackle &v) { o << CRACKLE << v; } void serialize(stream &o, const Pop &v) { o << POP << v; } > It takes full advantage of case sensitivity, which C and C++ deem good. We want to take advantage of case sensitivity in a good way, using the commonality of spelling but the distinction of case as a way of communicating with the reader of the code. Ada cannot mandate a good choice of names, but has prevented a potential good choice of names on the grounds of trying to eliminate one small set of possible bad choices. I don't buy that argument at all. > The compiler may have a different opinion of the meaning of an > identifier than does the human reader of the code. Such differences > of opinion can be problematic. But that happens as soon as any overloading, or even hiding, is allowed.