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,7eaf9f2597de2259 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-05 02:26:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!news.demon.co.uk!demon!pipehawk.demon.co.uk!not-for-mail From: john.mccabe@emrad.com.nospam (John McCabe) Newsgroups: comp.lang.ada Subject: Re: on package naming, should the word "_pkg" be part of it? Date: Fri, 05 Oct 2001 09:24:49 GMT Organization: Emrad Ltd Message-ID: <3bbd7a77.5463085@news.demon.co.uk> References: <9pif1o01btl@drn.newsguy.com> <9pii95$jus$1@nh.pace.co.uk> NNTP-Posting-Host: pipehawk.demon.co.uk X-NNTP-Posting-Host: pipehawk.demon.co.uk:158.152.226.81 X-Trace: news.demon.co.uk 1002273905 nnrp-14:9379 NO-IDENT pipehawk.demon.co.uk:158.152.226.81 X-Complaints-To: abuse@demon.net X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:13769 Date: 2001-10-05T09:24:49+00:00 List-Id: On Thu, 4 Oct 2001 16:53:56 -0400, "Marin David Condic" wrote: >My general opinion is that if a project adopts a naming convention, everyone >should strive to preserve it for the sake of consistency - no matter how >stupid a convention it may be. I agree, but it is obviously worth coming to some agreement on a convention that is not stupid in the first place. There is an article available somewhere on the net about Lessons Learned using Ada 95 in an OO Environment. It suggests things like, if you're using a package with a single tagged type as a kind of class, then name the package after its purpose and name the tagged type Object! So you get something like: package Car is type Object is tagged record .... end record; procedure DoSomething (This : in Object); .... end Car; In my last Ada position we found a large number of cases where this was just not sensible. Finally our agreement was to use the package name as the plural of the type of information it contained. So we would have: package Cars is type Car is tagged record .... end record; procedure DoSomething (This : in Car); .... end Cars; This generally worked pretty well, but we sometimes had some silly names for packages because of strange pluralisations on words like Radius etc! As far as _Type is concerned - I'm all for it, but it can be avoided by using The_ in front of objects. For example: type Car_Type is record .... end record; procedure DoSomething (Car : in out Car_Type); could be replaced by: type Car is record .... end record; procedure DoSomething (The_Car : in out Car); At the end of the day, as long as everyone is reasonably happy with whatever convention is decided on, *and follows it*, then there shouldn't be a problem. John