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: 103376,e55245590c829bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!news.unit0.net!noris.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 04 Nov 2010 11:09:25 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <4cd19583$0$6977$9b4e6d93@newsspool4.arcor-online.net> <82oca54q8a.fsf@stephe-leake.org> In-Reply-To: <82oca54q8a.fsf@stephe-leake.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4cd28655$0$7657$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 04 Nov 2010 11:09:25 CET NNTP-Posting-Host: cb40657d.newsspool1.arcor-online.net X-Trace: DXC=Y]7??nMMJjCFJ3]dH>I?oEic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBEB9B5hE=neFPCY\c7>ejVHQQfIKUEA2ZG4=UT`EJEKjD X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15207 Date: 2010-11-04T11:09:25+01:00 List-Id: On 11/4/10 6:23 AM, Stephen Leake wrote: > Notice that the "find a better name" camp always suggests _several_ > names, and each person suggests _different_ ones. That means there is no > common solution, and the resulting code will be confusing, and subject > to endless arguments about "the right name" in code reviews. > > At least with _Type, the solution is very clear. The choice of _Type just dissolves the issue. :-) Well, OK, sometimes a naming issue can be deferred to a later day, and/or to another person, in order to get on with the work at hand. But part of daily programming work is studying foreign code, written in a number of languages. (Suppose you are writing .NET programs and the examples are in F#, you write C++; or you need to transform some Ada tasks into a Fortran program using the MPI; or you are about to enhance an algorithm presented in Python.) Say you see program text with _Type. _Type is very much like the "abc: Abc" approach mentioned in this thread, that is used with case sensitive languages: it uses the same word twice. I'm saying the same word because both letter case and _Type do not change the meaning of words. "Weapon" means the same as "weapon" or "Weapon_Type", as far as the meaning of the things in the type's value set is concerned. "X_type" is only supposed to indicate a different *use* of the same word X. By using it, X still has its meaning unchanged. I once liked the case idea, too, but after having to switch languages every now and then, I wholly understand the complaints posted against tword: Tword. For a start, this convention forces one to become highly sensitive to the presence of case sensitivity in either language. The effect on the program's reader is a doubled effort. Worse, if you see FooType in Python, C++, whatever, the _Type suffix habit becomes a source of confusion. It is very likely possible that the authors have written "Type" to convey meaning, and not to have it indicate "'Foo' used as a type name". The effect is a higher risk of a misunderstanding. If every identifier is chosen for its meaning instead of for its function, then these two problems do not arise.