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,7ae84c67e252c8f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-24 19:51:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!p01!news2.central.cox.net.POSTED!53ab2750!not-for-mail Message-ID: <3D3F672A.50804@telepath.com> From: Ted Dennison User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Naming conventions References: <3D3F58F4.9050305@hotmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 25 Jul 2002 02:51:18 GMT NNTP-Posting-Host: 68.12.51.201 X-Complaints-To: abuse@cox.net X-Trace: news2.central.cox.net 1027565478 68.12.51.201 (Wed, 24 Jul 2002 22:51:18 EDT) NNTP-Posting-Date: Wed, 24 Jul 2002 22:51:18 EDT Organization: Cox Communications Xref: archiver1.google.com comp.lang.ada:27388 Date: 2002-07-25T02:51:18+00:00 List-Id: Ryan Tarpine wrote: > Coming from C++, what I used to think of as a class (a type and its > associated methods) is now roughly equivalent to a package. Whenever I A package with a tagged type in it, yes. > regular expression type in a package Regular_Expression. However, once > I name the package, I am at a loss for what to call the data type inside. > > I've been appending '_Type' to the package names, making names like > Vector_Type, but I don't think that is the Right Thing(TM). I've been No, its not. > skimming the style guides (which I heartily recommend all newbies to > do), and I've seen a little bit of calling the type simply Instance or > Object. When used with the package name this looks nice, such as > Vector.Instance. What do the Ada gurus normally do for this? :) If you are into making "class" packages with nothing but the one tagged type in them, that is probably the way to go. It does look a tad dorky though. Usually I find that if my package's only reason for existance isn't to provide one tagged type an appropriate name will present itself. Sometimes even then, you can get a better name than "instance" by taking it from further up the package hierarchy. Make sure to pay attention to how the names will look when fully specified. For example, "Ada.Strings.Unbounded.String" would be a far better type name that "Ada.Strings.Unbounded.Unbounded_String", and "Ada.Text_IO.File" would be much better than "Ada.Text_IO.File_Type". :-) > Don't worry I don't intend to spark any naming "religious wars" like > http://www.informatik.uni-stuttgart.de/ifi/ps/ada-doc/style_guide/sec_3a.html#3.2.4 > > warns :) They say the road to hell is paved with good intentions. I don't know about that though. After all, the road I'm on right now seems to be paved that way. Errr...wait a minute....