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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Type naming conventions: Any_Foo Date: Thu, 5 Dec 2019 21:47:11 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 5 Dec 2019 20:47:11 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="ddbb247c959f2e7fbc1f00c09e538ea7"; logging-data="4154"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gHcemXrJHyiXcLudi5zt/Nyhkznl9QH0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 Cancel-Lock: sha1:4RhhPRRag5VxGzSmrwU3ofNYoIg= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57661 Date: 2019-12-05T21:47:11+01:00 List-Id: On 12/5/19 8:49 PM, Niklas Holsti wrote: > > Either of those is itself defining a convention. It seems every enumerated type > would then get an "_ID" or "_Name" suffix. Or something similar. Many enumeration types are identifiers or names; some are not. A convention would end every enumeration type name with the same suffix, even when it's not appropriate. Well chosen type names would perhaps result in many such names ending in the same suffix, but not all. As an example, the PragmAda Reusable Components have 13 lines returned by grep -i "type *[a-z0-9_]* *is *(" *.ad? 8 of them end in _I[Dd] (I really should make the casing consistent), 1 in _Name, and 4 others. Had I used the convention of _ID rather than making the effort to think of good names, about 1/3 of those names would be less meaningful. Had I used a meaningless convention like _T for all type names, all of those names would be less meaningful. Meaningful names are easier to read, and ease of reading is an important goal of S/W engineering. -- Jeff Carter "Ada has made you lazy and careless. You can write programs in C that are just as safe by the simple application of super-human diligence." E. Robert Tisdale 72