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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dfe340a115a0bc1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-03 16:27:18 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Naming convention for classes? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 04 Feb 2004 00:27:18 GMT NNTP-Posting-Host: 63.184.8.121 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1075854438 63.184.8.121 (Tue, 03 Feb 2004 16:27:18 PST) NNTP-Posting-Date: Tue, 03 Feb 2004 16:27:18 PST Xref: archiver1.google.com comp.lang.ada:5204 Date: 2004-02-04T00:27:18+00:00 List-Id: Peter C. Chapin wrote: > package Date is > type Object is private; > > procedure Advance(Item : in out Object; Step : in Integer); > ... > end Date; > > The I can create Date objects by first withing Date and then doing > > Today : Date.Object; > ... > Date.Advance(Today, 100); > > package My_Library is > type Date is private; > > procedure Advance(Item : in out Date; Step : in Integer); > ... > end My_Library; > > Then I might with My_Library and use My_Library and do > > Today : Date; > ... > Advance(Today, 100); Is this a troll? You'll find ample discussion of this (naming types and packages) if you search c.l.a at groups.google.com. Some people are very attached to one approach or the other. The 2 approaches you mention are called "use unfriendly" and "use friendly", respectively. There are arguments for and against both approaches. Ada's standard packages are use friendly. For example, package Ada.Strings.Unbounded declares type Unbounded_String. If you create use friendly packages, you should not consider the package name to be noise. "Ada.Strings.Unbounded" is not just noise. One approach is to use appropriate suffixes to create useful names: package Date_Handling is type Date_Info is private; procedure Advance (Date : in out Date_Info; Num_Days : in Positive); Note that with this approach the reader can tell that you're advancing a date by a number of days without any comments. Note also that negative numbers of days are not allowed, as that would not be considered advancing a date. -- Jeff Carter "Your mother was a hamster and your father smelt of elderberries." Monty Python & the Holy Grail 06