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,2afac1a4161c7f35 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Distinguishing type names from other identifiers Date: 1998/01/14 Message-ID: #1/1 X-Deja-AN: 315907136 References: <884736089.2104295427@dejanews.com> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: 884798084 18499 bpr 206.184.139.132 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-01-14T00:00:00+00:00 List-Id: On Tue, 13 Jan 1998, Adam Beneschan wrote: > After following this thread, and looking at this example, I really > wonder what the objection is to using _Type suffixes. Several people > have objected to "_Type" on the ground that it doesn't add any > informational value to the name. But do the extra words in the above > example add any value to the name, either? I'm not convinced that > calling the type Hour_Of_Day is any more helpful to a programmer than > just calling it Hour or Hour_Type. I am in complete agreement. > So if I'm right and anything you add is just noise, I think it may be > best to use a boring suffix like _Type. The small advantage to this > is that it may make your names easier to remember. If you use _Type > consistently, at least you have less information to carry around in > your head, instead of trying to remember something different for each > type: "Now, let's see, did I call this one _Number, or _Of_Day, or > _Of_Hour, or what?" leading to potential errors such as the one Nick > included in his above example. Also, in generic code (meaning, Ada generics) it isn't always appropriate to use specificity to distinguish, since the entities are, well, generic. If one is going to use a suffix, another question that comes up is what to do with access types when you want them distinguished from the non-access version. In C (sorry, I am a C programmer too) I use capitalized intercap for type names, so a I might have names like CircListT, CircListPT. Ada programmers seem to dislike abbreviations, but I really don't like type names like Circular_List_Access_Type. _Ptr might work, but I usually use that for variable names. What do people who use suffixes generally do? -- Brian