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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1b41412c7bc28c47 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder2.ecngs.de!ecngs!feeder.ecngs.de!news.osn.de!diablo2.news.osn.de!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 07 Aug 2008 09:16:04 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Suffix _T for types found good References: <2e9ebb23-a68b-43cf-8871-febcb173f951@56g2000hsm.googlegroups.com> <188191be-d2c6-4d94-8d6b-082015954332@t54g2000hsg.googlegroups.com> <489A0440.9080201@obry.net> <594cdbb8-4018-44bd-a8db-0df3f23df247@z72g2000hsb.googlegroups.com> In-Reply-To: <594cdbb8-4018-44bd-a8db-0df3f23df247@z72g2000hsb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <489aa138$0$20716$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Aug 2008 09:16:08 CEST NNTP-Posting-Host: 100b131a.newsspool4.arcor-online.net X-Trace: DXC=8i9XM7dVI1=nBOkdL^Lo7>4IUK\BH3Y2kGhcdL amado.alves@gmail.com wrote: > And even if you can come up with good different names for types and > objects, even if you magically did that effortlessly, why double the > lexicon? Can it possibly make the code better? Just to avoid a suffix > rule? Some points of reference for choosing names, collected here and there. They are not perfect rules, but I think they make sense: - Can you answer the questions, [a] "What kind of Node are these?" -> secific type [b] "What kind of Node is this one?" -> specific object A type in the sense of [a] comprises many things and is possibly served well by a generic term. At first sight, "Node" is such a term: assigning different meanings to "Node" is easy. Too easy. It doesn't say what kind of Node. In a given program's context, the nodes refer to some larger thing of which they form part. This relation may offer advice on chosing a qualification of Node. A package name can serve as a qualifying addition. There may even be another word that somehow includes the notion of Node. An object in the sense of [b] has identity. Identity is usually designated by a locally unique specific name. The name can allude to the specifics. "Central_Star" or even "Sun" are possibly better names than just "Celestial_Body" or "Node", I should think. The identity can be a bit of a formal identity. For example, a subprogram parameter name designates a specific object during each invocation. But there are many invocations. Each gets a different specific node. In this case, a convention is to use the prefix "The_" to indicate identity: procedure Foo(The_Node: ....); The name here expresses that Foo is going to deal with just one node, namely The_Node. But when declaring specific objects, e.g. nodes in certain roles, Junction: ...; Crossing: ...; It seems to be tempting to just use some variation of a type name for objects. Example: osw: OutputStreamWriter; -- NOT! is typical of programs targetting the JVM. So the reader remembers that "osw" designates some output channel. But which one? The programmer was too lazy to think of a name. Points of reference: The purpose of this output. Where does it end? Which ends does it connect?