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 Path: g2news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 02 Nov 2009 20:54:56 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) References: <4ae9dade$0$6551$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <4aef3911$0$7617$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 02 Nov 2009 20:54:57 CET NNTP-Posting-Host: 28417597.newsspool1.arcor-online.net X-Trace: DXC=Z>^SkKlN3;Aj7E:bke<5HFic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBZ4`Yna[0]:Nnc\616M64>JLh>_cHTX3jM=fWH?eHT]YM X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8941 Date: 2009-11-02T20:54:57+01:00 List-Id: Stephen Leake schrieb: > "Jeffrey R. Carter" writes: >> When you see >> >> Append (List => List, Element => Element); >> >> you don't really know what's being appended to what. > > In a purely generic context, like in the body of > Ada.Containers.Indefinite_Doubply_Linked_LIsts, that is precisely what > you should know. > > What's wrong with that? First, few people write purely generic code. Stepanov et al. do. You do. Their admirable work has nevertheless created new words in a new anguage by way of overloading. (Can I suggest the name Techlish ?) Example: Combine "push" and "onto the back end" to have a mathematician from Moscow create the word "push_back" for that. To me, that is 90� off, never mind. (Just a speculation about the origin of push_back. Absolutely no offense intended!) And the concatenation "push" & "_back" is about the linguistic support for the specification of meaning in STL programming there is! Unfortunately, when you work for some time on one subject, its context becomes familiar to you---but not to others; what is more, and as regards Ada.Containers work, is that the STL and other generic programs revolve all around (a) generic algorithms, (b) a certain machine model. The machine model is necessarily of its own abstract nature. It is the starting point for programming solutions using generic algorithms. Unfortunately, neither the STL nor other libraries offer but internally sensible names. They all force us to switch from our domain to the generic machine. There is a gap in naming mechanisms; everything is lumped together in slang names and most abstract, fluffy terms, full of allusions to the theory behind, but lacking a real mechanism that links the generic composition with the rest of the program. Name wise. We'd need that in order to bridge the gap between the two naming conventions. There is therefore potential for tons of questions if all a "non-generic" programmer sees is "List" or "Size" in all sorts of places in a program. These words should be endemic among generic library authors, yes. But why anywhere else? > Op_1 (onto => list, element => object_1); > Op_2 (from => list, element => object_2); > Op_3 (container => list, element => object_3); > > It's much easier if it's always "list => list". Well, ease as an excuse... I find it much easier to write C++, fast; C++ at some level is much easier and more permissive---easier until there is some odd crash and you look through the large combinatorial array of generic library names(!) in a long diagnostic message... I think the ease argument will be interesting if it becomes clear what the Op_N stand for, respectively. The third line is notably not overloading the parameter name "List" and the type name "List". Cf. valid Eiffel: local string: STRING do ... -- more uses of string and STRING. Or StrINg. (Somewhat at odds with the 1-name-rule of that language. I have only a single name space in my brain...) Is this example as confusing than Op (List : List)?