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-Thread: a07f3367d7,25d835bb9a4a003f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!u-picardie.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) Date: Mon, 2 Nov 2009 15:47:18 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <4ae9dade$0$6551$9b4e6d93@newsspool4.arcor-online.net> <4aeaecbd$0$6588$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1257198441 22071 69.95.181.76 (2 Nov 2009 21:47:21 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 2 Nov 2009 21:47:21 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news2.google.com comp.lang.ada:8946 Date: 2009-11-02T15:47:18-06:00 List-Id: "Stephen Leake" wrote in message news:uskcz6ahs.fsf@stephe-leake.org... ... > Here are the similar definitions from > Ada.Containers.Indefinite_Doubly_Linked_Lists. I hope you won't start > arguing that is a bad abstraction. > > package Ada.Containers.Indefinite_Doubly_Linked_Lists is > > type List is tagged private; > > generic > with function "<" (Left, Right : Element_Type) return Boolean is <>; > package Generic_Sorting is > > function Is_Sorted (Container : List) return Boolean; > end Generic_Sorting; > end Ada.Containers.Indefinite_Doubly_Linked_Lists; > > Note that it uses _Type for Element! If anyone cares, that's because we used a form of Stephen's rules for naming these. In this case, we determined that the best name ("Element") should be reserved for the operation, as the operation will likely be used many times, while the formal type name is hardly ever written in client code (just as a name in the instance) -- note this ties into one of the previous threads here. We considered using longer names for the operation like "Get_Element", "Read_Element", etc., but those just made the name longer without adding enough additional information. After all, an important rule is to make names long enough to capture all of the critical information, but no longer (because there is a point where names get too long for readability). Randy.