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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,23963231b5359f74 X-Google-Attributes: gid10ad19,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-Thread: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-Thread: 11440e,23963231b5359f74 X-Google-Attributes: gid11440e,public X-Google-ArrivalTime: 2001-06-02 13:26:08 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!dispose.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!zap!not-for-mail From: Simon Wright Newsgroups: comp.lang.ruby,comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml Subject: Re: Long names are doom ? Date: 02 Jun 2001 07:19:53 +0100 Organization: CodeFella Message-ID: References: <3B0DBD4A.82943473@my-deja.net> <3B0DD011.88FCD00E@acm.org> <83WP6.3874$yc6.728572@news.xtra.co.nz> <3B1411D0.3AAF42E7@ftw.rsc.raytheon.com> <9f2nks$ibd$0@dosa.alt.net> <3B177EF7.2A2470F4@facilnet.es> <3B17D201.11A3CA69@ftw.rsc.raytheon.com> NNTP-Posting-Host: localhost X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 X-Trace: news.demon.co.uk 991513544 nnrp-12:11577 NO-IDENT pogner.demon.co.uk:158.152.70.98 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: 2 Jun 2001 06:19:55 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ruby:10344 comp.lang.ada:8023 comp.lang.awk:2703 comp.lang.clarion:20915 comp.lang.java.programmer:73035 comp.lang.pl1:712 comp.lang.vrml:3437 Date: 2001-06-02T06:19:55+00:00 List-Id: Wes Groleau writes: > > Ages and ages ago, I suggested to the editors of Ada Quality and > > Style (as part of the public comment process) that they use the > > following convention: > > > > type Dogs is (German_Shepherd, Sheep_Dog, Dog_Pound_Dog); > > Dog : Dogs; > > > > That is, plural for type names, singular for object names. You'd be > > surprised how often that works out. The editors even adopted it as > > their recommendation in an early edition of AQ&S. > > > > Evidently some CS professor types were aghast at the simplicity of this > > I think it's more a matter of "sounding like English" > > > proposal, and a later version of AQ&S changed it to something like > > "abstract words for type names, specific words for object names" -- > > advice that's impossible to understand, much less follow. > > I would say "easy to understand, not too hard to follow, and makes > the code very readable." > > > I found this culture clash perfectly understandable: I'd come from an > > engineering background, so type names like Amperes and Foot_Pounds came > > naturally. > > But you ARE following the abstract/specific guideline if you say > > type Amperes is ..... > > Widget_Current : Amperes; I suspect it's a matter of whether the thing we want to name is fungible or not :-) Your ampere is quite indistinguishable from my ampere. Your metre is the same as mine. So when we're naming quantities it seems to come quite naturally to use plurals: type Watts is new Float; Present_Dissipation : Watts; and indeed I found myself the other day doing that perfectly naturally. On the other hand, when you're discussing things that are distinguishable, the use of plurals gets pretty uncomfortable. It's the same distinction as between 'less' and 'fewer', I think. If you think of a department store, you might be interested in the number of employees: sybtype Employees is Natural; Staff_Number : Employees; but if you are interested in Alice, Bob and Carol specifically it seems very odd indeed to say type Employees is record .. end record; Alice : Employees; if for no other reason than that you also need a word to name the type 'collection of employees' (the database table you keep the employee records in, for example). I'm not so sure about enumeration types. Seems that the Dogs type above would be more natural as Dog_Kind or, in this universe, Breed. I agree you get into trouble with naming variabls of type Breed (The_Breed, anyone!). [I do somewhat question the validity of Dog_Pound_Dog; I think it should probably be Mongrel, even sheepdogs may find themseleves in the pound.] However .. I made the distinction between 'less' and 'fewer' above. I get the impression that fewer and fewer people would understand what I mean there, and the last thing I want is to send the team off into a half hour of navel gazing every time someone needs to name a new type! Perhaps a simpler rule set that meant they only needed to take 15 minutes would be better .. note, I think names are important, it's worth spending time on them, naming is real work, you need Name Police, it's just not the only thing to think about! -Simon