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: a07f3367d7,e55245590c829bef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!u10g2000yqk.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Mon, 1 Nov 2010 17:07:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1288656447 21809 127.0.0.1 (2 Nov 2010 00:07:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 2 Nov 2010 00:07:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u10g2000yqk.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:15137 Date: 2010-11-01T17:07:27-07:00 List-Id: On Nov 1, 12:19=A0pm, Jeffrey Carter wrote: > On 11/01/2010 10:06 AM, Mart van de Wege wrote: > > > Shark8 =A0writes: > > >> You could have appended "_Type" to the type declaration giving > >> "Character_Type." > >> This gives the added advantage of allowing your parameters to be > >> highly descriptive, especially if you use named-association when > >> calling the parameters. > > > That's another way around it. Nice. Thanks. > > No, not nice. Terrible. > > "_Type" is just noise; you could use "_Global_Nuclear_Warfare" just as we= ll. You > should never be adding unnecessary noise to your code. > > 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= . > > In this case, the type defines the information for dealing with a Charact= er, so > I'd probably use Character_Info as the type name. I kind of like the idea of coming up with a synonym instead. The word "Character" is just used *too* commonly in programming, regardless of the programming language, to refer to a small piece of data that usually represents a single letter in some language, digit, punctuation mark, or other special symbol. Using this name, or any variant of it (like Character_Type or Character_Info), for some other meaning (like a character in a play) is IMHO just going to confuse things for other programmers trying to read your code. Of course, if you're the only one who's ever going to read your code, you can call it any bloody thing you like, like Ch or CXRQS or Global_Nuclear_Warfare (although the last would be appropriate only if your Character is played by Matthew Broderick....) -- Adam