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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:aed:35e5:: with SMTP id d34mr7010342qte.298.1575543094996; Thu, 05 Dec 2019 02:51:34 -0800 (PST) X-Received: by 2002:a9d:51ca:: with SMTP id d10mr5811839oth.76.1575543094774; Thu, 05 Dec 2019 02:51:34 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!g89no7558315qtd.0!news-out.google.com!w29ni139qtc.0!nntp.google.com!g89no7558306qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 5 Dec 2019 02:51:34 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.22.143.114; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 185.22.143.114 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Type naming conventions: Any_Foo From: AdaMagica Injection-Date: Thu, 05 Dec 2019 10:51:34 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57654 Date: 2019-12-05T02:51:34-08:00 List-Id: Of all of these schemes, my favorite is Package Foos Type Any_Foo Object Foo This is tightly related to the discussion predefied types vs. user defined types. It's not always easy, ahem it's often difficult to find good names. I think finding good names and spending time on this is well spent effort. I do not know who posted this example a long time ago, but I like it: Do not use abbreviations. Good names make a program understandable. What is Wpn? type Weapon_Type is (Broadsword, Catapult, Bow_and_Arrow); procedure Attack_Using (Weapon: Weapon_Type); Weapon: Weapon_Type; Attack_Using (Weapon => Catapult); -- a bit talkative Attack_Using (Catapult); -- good only with positional association versus type Weapon is (Broadsword, Catapult, Bow_and_Arrow); procedure Attack (Using: Weapon); My_Weapon, Foes_Weapon: Weapon; Attack (Using => Catapult); -- good only with named association Attack (Catapult); -- Do we attack the catapult or what?