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-7-bit X-Google-Thread: 103376,8d472879e3f609e0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-04 13:24:25 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Case sensitivity (was Re: no title) Date: Wed, 4 Jun 2003 15:24:22 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: 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> <1054756824.267420@master.nyc.kbcfp.com> X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:38641 Date: 2003-06-04T15:24:22-05:00 List-Id: "Hyman Rosen" wrote in message news:1054756824.267420@master.nyc.kbcfp.com... > 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. Well, the EPA, the CDC, et al. mandate the elimination of "a small set of bad" molecules (e.g. small being on the oder of parts per billion or parts per million), in our food, drink, and air, so where people's lives are at stake, many programmers (I, for one) do "buy that argument." > > > > 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. > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >