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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/08/31 Message-ID: #1/1 X-Deja-AN: 386398736 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-08-31T00:00:00+00:00 List-Id: Matthew Heaney (matthew_heaney@acm.org) wrote: : "John G. Volan" writes: : > Ada's mechanism is to force the identifiers to be literally different, : > which means either adding some kind of noise word to one or the other, : > or resorting to abbreviation for one or the other. : > ... : I do this sort of thing too: : PDW : Pulse_Descriptor_Word; : : SOI : Signal_Of_Interest; : Speed : Speed_In_Knots; A better choice for object names is often something that indicates the specific role the object plays, rather than a name that simply echos its type name. Presumably there is more than one object of a given type in existence. The names ought to distinguish these objects by hinting to the reader what they are used for. For example, an object of type "Speed_In_Knots" is presumably the speed for some particular other entity. Presuming that that other entity has a meaningful name, then its speed might be named "_Speed". Prepositions like "From" or "To", qualifiers like "Source" and "Target" or "Next" and "Prev", etc., often are better than just names that parrot the type. Remember that every name is a chance to communicate something of interest to the reader. Make every name count (sounds like bidding in the game of "Bridge" -- "make every bid count"). -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company