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!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Type naming conventions: Any_Foo Date: Thu, 5 Dec 2019 21:49:38 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net xv0FhQOqRzShm5dNLiXSZAxEHihH2id7Lpz40KMBlpwqCnBp7i Cancel-Lock: sha1:JMYYruuSvqe2fSgEGvCkVplW5EQ= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57659 Date: 2019-12-05T21:49:38+02:00 List-Id: On 2019-12-05 19:27, Jeffrey R. Carter wrote: > On 12/5/19 11:51 AM, AdaMagica wrote: >> >> (Broadsword, Catapult, Bow_and_Arrow); > > There are 2 ways to look at them: > > 1. These identify the possible weapons: Weapon_ID > 2. These are the names of the possible weapons: Weapon_Name Either of those is itself defining a convention. It seems every enumerated type would then get an "_ID" or "_Name" suffix. Or something similar. In my programs, it is very often the case that some object both has a type, and has an (internal) identifier, and has an (external) name. So the identifiers Weapon_ID and Weapon_Name would be suitable for those other types, but not for the Weapon type/concept itself. > I would even say that those who use naming conventions such as > _T[y[p[e]]] are either not S/W engineers or are shirking their duties. Ouch (I use the "_T" convention). As an alternative to the "_T" convention, I could consider using longer, compound names for formal parameters, for example procedure Kill (With_Weapon : in Weapon) I often use such compounds also with the "_T" convention. Unfortunately, I have found that this often leads to rather artificial and hard-to-remember compounds, and is even harder to apply sensibly to local variables (as opposed to formal parameters). So I go with "_T". -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .