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,25d835bb9a4a003f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) Date: Fri, 30 Oct 2009 11:36:15 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <4aea9607$0$6254$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 3a84f3e5574ec25d8f889bdd4bc04f58 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 5706243990ca2dd91feea9b1d95e0ed2 X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <4aea9607$0$6254$4f793bc4@news.tdc.fi> X-Validate-Post: http://news.tornevall.net/validate.php?trace=5706243990ca2dd91feea9b1d95e0ed2 X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news2.google.com comp.lang.ada:8896 Date: 2009-10-30T11:36:15-07:00 List-Id: Niklas Holsti wrote: > > Interesting. How does you project solve the type-naming problem? Do you > have some positive rules for naming types and objects, or only those > negative prohibitions against suffixes and prefixes? We don't have any rules (that must be obeyed), but we do have guidelines. I have listed them before. First, save the best name for parameters. This means the type name is always 2nd best. Then, there are some common naming conventions that apply in many situations. Numeric types often represent values, and _Value is often a meaningful way to form the type name. Enumeration types are often names or IDs, so _Name or _ID. Arrays are often lists or sets, so _List or _Set. Record types often provide the necessary information about something, so _Info. In some cases, _Group is good. Private types let you manipulate something without knowing what's in it, so _Handle often seems appropriate. _Handle also often seems good for access types. But we always want the (2nd) best name; a private type used as an ID would have _ID, not _Handle. A type that acts as a key (in a map, for example) might be _Key. -- Jeff Carter "I spun around, and there I was, face to face with a six-year-old kid. Well, I just threw my guns down and walked away. Little bastard shot me in the ass." Blazing Saddles 40