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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/08/06 Message-ID: #1/1 X-Deja-AN: 378411503 Sender: matt@mheaney.ni.net References: <6pdhfo$1br$1@platane.wanadoo.fr> <6pi0pf$df8$1@nnrp1.dejanews.com> NNTP-Posting-Date: Wed, 05 Aug 1998 21:37:53 PDT Newsgroups: comp.lang.ada Date: 1998-08-06T00:00:00+00:00 List-Id: Robert A Duff writes: > I'll just point out that this discussion about type names hinges on > whether you're a use-ophile or a use-ophobe. To the former, > "X: Instance;" looks silly (or wrong); to the latter, > "X: Bounded_Text_Strings.Bounded_Text_String;" looks silly. > > The strange thing about Ada is that the programmer who writes a package > must choose whether use_clauses will make sense (by choosing sensible > names for either option), whereas the client of that package gets to > choose whether to actually have a use_clause. Funny you should bring that up. The more I think about it, the more I think that use-semantics should be the default when you with a package. In other words, the language should have been designed so that use clauses weren't even necessary. Your observation explains why some programmers object to the plural package name convention, saying "Oh but that name just duplicates the type name." They must be use-a-phobics. I'm a use-a-phile, so of course I'd use Bounded_Text_Strings, and wouldn't dream of writing anything but declare X : Bounded_Text_String; begin If you see a declaration like that, then there's a very high probability that type Bounded_Text_String was declared in package Bounded_Text_Strings, which is of course the reason for naming the package that way. Some shops give themselves rules like Thou Shalt Not Use Use, but that rule is misguided. The real rule should be, Thou Shall Make It Easy To Trace A Type Back To The Package It's Declared In. By naming the package the plural of the type name, then the latter rule is satisfied, in spite of use being used.