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: g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 09 Nov 2009 13:09:42 -0600 From: "Vincent Marciante" Newsgroups: comp.lang.ada References: <4ae9dade$0$6551$9b4e6d93@newsspool4.arcor-online.net> <4aef3911$0$7617$9b4e6d93@newsspool1.arcor-online.net> <4af2ba89$0$6566$9b4e6d93@newsspool4.arcor-online.net> <4af42f5b$0$7624$9b4e6d93@newsspool1.arcor-online.net> <4af5841f$0$6583$9b4e6d93@newsspool3.arcor-online.net> Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) Date: Mon, 9 Nov 2009 14:09:38 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Message-ID: X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.99.9.146 X-Trace: sv3-XUT/Apebx+MTbhQJxyrIPXgiwaSM3Dbk5jiioNARgQkgge8TjqgtekX4Wp08ir1ftYowUzNXo8qlMsN!dM3PlaTZhH4gEIE3yc84P4f+jc1Pfd+PkPNaIby1gS4DYySSzB+NMeeSe67H9Ynz1dk/LbfKJk4W!hnqtv6AqEGYrX12jaUHC8QHoetRNL2w= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Xref: g2news1.google.com comp.lang.ada:8064 Date: 2009-11-09T14:09:38-05:00 List-Id: "Stephen Leake" wrote in message news:u3a4pqrcz.fsf@stephe-leake.org... > Georg Bauhaus writes: > >> On 11/7/09 6:49 AM, Stephen Leake wrote: >> >>> One reason to use "_Type" is precisely _because_ it means "Ada type"; >>> there's no need to wonder about what it means. >> >> But the language meaning of "type" does not help with >> the mentioned Message_Type_Type? >> If I stubbornly follow your conventions as I understand them, >> I'd have to write >> >> procedure Something (Message_Type : in Message_Type_Type); >> or >> procedure Something (Message_Type : in Message_Types.Message_Type); >> >> wouldn't I? > > Yes. This is the only special case, and usually I just stubbornly > follow the convention. You get used to it. > > Another choice is to use Message_Label instead; > > procedure Something (Message_Label : in Message_Label_Type); > >>> In another post, someone said Eiffel required<> around types; is that >>> not true? >> >> I mentioned Dylan where you would write string : ; > > Ah, sorry for the confusion. > >> >> In Eiffel, and in hypothetical 2-namespace-Ada you write STring: >> STring, if you want to. The visual difference is none. Is the >> difference in meaning perfectly clear in the body lines following >> the declaration? > > No, there are times when either an object or a type could be used, in > attributes. Which is probably why Ada has a single namespace. > >>>>> Yes, this is an example of name overloading. Overloading, like any >>>>> good thing, can be abused. >>>> >>>> Assuming separate namespaces for objects and types, >>>> I can imagine programmers who find "string : STRING" >>>> very clever. Or just a good match for some twisted programming >>>> trick. Why make cleverness, or the appearance thereof, >>>> easy to achieve? >>> >>> Good programmers will just find it natural; why introduce twisted >>> programmers into this? >> >> OK, I thought that the design of a general purpose programming >> language, together with the naming conventions surrounding it, >> should be manageable by a general public of programmers, not just >> "programmers who find this natural" =:def "good programmers". >> Some good programmers, in fact language makers, >> have made String : String impossible. > > Yes, for good reasons. > >> Supposedly, then, they did not deem String : String a natural thing, >> even though they were good programmers. > > That's a stretch! Avoiding actual ambiguities is a better reason. But > I don't presume to read their minds. It would be interesting to read > some rationale on this; I don't think there is any in the Ada Language > Manual. What I gathered was that the original chief language designer constructed the language rules with a goal of trying to drive/impose the necessity of "good" program architecture and trying to prevent/discourage "bad" program architecture and I think that the following was one of the things that was to be promoted: - separating (having in different packages) the declaration of types (abstract data types) and object of the type. I think that having two namespaces would have made having both in the same declarative region easier but that would only really come up for the type and only one object (or as a yucky "workaround") an array of them) declared together. Clearly, whenever there are two objects of the type, the simple name of one of them _must_ be different than the name of the type unless they are in different declarative regions. I think that separate object and type namespaces would simply have been redundant. Also, I showed that the "parameter of subprogram declaration" case (which was the old example that I brought up in an earlier message) is easily and elegantly dealt with by the sjkdf.type_name construct So, that there is really no need for two namespaces but there also is really is no need for any overall naming convention either! As to why there is "File_Type" in Text_IO instead of various Sub(File:Text_IO.File) declarations, I'd for a couple of reasons) say it was just a "mistake" due to expediency. My reasons are: (1) The big text_IO package was not part of the original language, it was added (relatively quickly?) in order to reduce the amount of generic instantiations that would be required to do simple io. (2) The original chief designer afterward acknowlegded/commented that he thought that even having text_io depend on the predefined "integer" was a mistake. With all of that I am not trying to be be "diffinative" in any way, I'm just putting out what I remember and (though about) from earily on at the start of my use of Ada. I hope that at least some of what I wrote is at all useful (and that none of it is inacurate!) Vinny