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: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake 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> <4cd28655$0$7657$9b4e6d93@newsspool1.arcor-online.net> Date: Sat, 06 Nov 2010 12:53:01 -0400 Message-ID: <82y696z95e.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:YBLpYeBgNrI1w7DU6gjsLMCwHqo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 34e7b4cd5856de9cdf0b032005 Xref: g2news2.google.com comp.lang.ada:16310 Date: 2010-11-06T12:53:01-04:00 List-Id: Georg Bauhaus writes: > 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. :-) Yes. What's wrong with that? > 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. Yes. > 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. Right. > 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. Doubled compared to what? I don't like the pure case distinction becuase it does not convey when spoken. _Type doesn't have that problem. > 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. That's purely dependent on the naming convention. If the convention is to use Type for all types, there is no risk of understanding. If there is no convention at all, then there will be misunderstanding. > If every identifier is chosen for its meaning instead of for its > function, then these two problems do not arise. If a clear, simple, consistent naming convention is used, these problems do not arise. Please stop putting up straw man arguments! -- -- Stephe