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,FREEMAIL_FROM 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,UTF8 Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Mon, 01 Nov 2010 20:41:54 +0100 Organization: Ada @ Home Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> NNTP-Posting-Host: ROGs2ZsQN9QaLpliT0TrGQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.63 (Win32) Xref: g2news1.google.com comp.lang.ada:15123 Date: 2010-11-01T20:41:54+01:00 List-Id: Le Mon, 01 Nov 2010 20:19:51 +0100, Jeffrey Carter = a =C3=A9crit: > No, not nice. Terrible. > > "_Type" is just noise; you could use "_Global_Nuclear_Warfare" just as= = > well. You should never be adding unnecessary noise to your code. Actually, this convention appears in many places, like the ARM. Ex: subtype Buffer_Type is System.Storage_Elements.Storage_Array (1..Buffer_Size); And to talk about good names, you may agree _Global_Nuclear_Warfare does= = not express the same at all as _Type does. This is even more clear if yo= u = have some _Access. > > S/W engineering involves putting in the effort to think of good names = = > for everything in your code. "_Type" is a kludge to avoid doing that = > thinking. Names, roles, behavior, traits, and so on. There are many place where th= e = sole surrounding context is not enough. > In this case, the type defines the information for dealing with a = > Character, so I'd probably use Character_Info as the type name. If the design is good, then Character already holds what identifies a = Character. With OO design, this _Info is then implicit and every where = (this one, is really noise ;) ) -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens.