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: Fri, 6 Dec 2019 21:11:13 +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: 8bit Injection-Date: Fri, 6 Dec 2019 20:11:14 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="255dba8a204173ca31bbda2f999c53ca"; logging-data="7080"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oikvusnNZos+4iM/U0kKYtN4j3GUeq90=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 Cancel-Lock: sha1:4NRP243woqV0SY5ESxxcwBXWlq0= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57670 Date: 2019-12-06T21:11:13+01:00 List-Id: On 12/5/19 10:33 PM, Niklas Holsti wrote: > > But if a value of the type Weapon_Id is an identifier of a Weapon, how can you > defend saying > >    Weapon : Weapon_Id; > > The variable Weapon does not represent a Weapon; it represents an identifier of > a Weapon, so the name Weapon is IMO a little misleading. Obviously there are no weapons in the S/W; there are only bit patterns that you have decided to interpret in various ways. But if you're modeling the problem space and it contains something called Weapon, then your software had better have something named Weapon it in, too. I would probably write something like type Character_Info is record ... Available_Weapons : Weapon_Lists.Vector; Current_Weapon : Positive; ... end record; but it sounds as if you think those fields should be named Vector and Positive. -- Jeff Carter "Brave Sir Robin ran away." Monty Python and the Holy Grail 59