comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Distinguishing type names from other identifiers
Date: 1998/01/14
Date: 1998-01-14T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.3.96.980114090556.23529A-100000@shell5.ba.best.com> (raw)
In-Reply-To: 884736089.2104295427@dejanews.com


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






  reply	other threads:[~1998-01-14  0:00 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-13  0:00 Distinguishing type names from other identifiers Adam Beneschan
1998-01-14  0:00 ` Brian Rogoff [this message]
1998-01-15  0:00   ` Michael F Brenner
1998-01-15  0:00     ` Nick Roberts
1998-01-16  0:00       ` Robert Dewar
1998-01-16  0:00         ` Michael F Brenner
1998-01-16  0:00           ` Robert Dewar
1998-01-16  0:00             ` Robert Dewar
1998-01-16  0:00             ` Brian Rogoff
1998-01-17  0:00               ` nabbasi
1998-01-18  0:00                 ` Robert Dewar
1998-01-18  0:00                   ` who owns the code? was " nabbasi
1998-01-18  0:00                     ` Robert Dewar
1998-01-19  0:00                       ` nabbasi
1998-01-19  0:00                         ` Robert Dewar
1998-01-20  0:00                           ` Paul Van Bellinghen
1998-01-21  0:00                             ` Robert Dewar
1998-01-21  0:00                               ` nabbasi
1998-01-22  0:00                                 ` Robert Dewar
1998-01-22  0:00                                   ` nabbasi
1998-01-21  0:00                               ` nabbasi
1998-01-22  0:00                                 ` Robert Dewar
1998-01-26  0:00                           ` Matthew Heaney
1998-01-20  0:00                       ` Anonymous
1998-01-20  0:00                         ` Robert Dewar
     [not found]               ` <69rnvv$ <dewar.885475174@me>
1998-01-23  0:00                 ` James Hopper
1998-01-23  0:00                 ` James Hopper
1998-01-22  0:00                   ` Robert Dewar
     [not found]                 ` <6a8mir$caa@nn <dewar.8855 <6a8vgd$cr7@nntp1.erinet.com>
1998-01-23  0:00                   ` Robert Dewar
1998-01-23  0:00                     ` Paul Van Bellinghen
1998-01-23  0:00                       ` Robert Dewar
1998-01-23  0:00                   ` Richard Kenner
     [not found]                 ` <6a8mir$caa@nn <dewar.8855 <6a8vgd$cr7@nn <dewar.885555487@merv>
1998-01-24  0:00                   ` James Hopper
1998-01-21  0:00           ` Philip Brashear
1998-01-20  0:00         ` Benoit Jauvin-Girard
1998-01-20  0:00           ` Robert Dewar
1998-01-19  0:00 ` who owns the code? was " Anonymous
1998-01-19  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1998-01-25  0:00 tmoran
1998-01-25  0:00 ` Brian Rogoff
1998-01-26  0:00   ` Nick Roberts
1998-01-14  0:00 tmoran
1998-01-14  0:00 ` Robert Dewar
1998-01-14  0:00   ` Brian Rogoff
1998-01-14  0:00     ` nabbasi
1998-01-15  0:00       ` Brian Rogoff
1998-01-10  0:00 Two simple language questions (plural types) Matthew Heaney
1998-01-12  0:00 ` Anonymous
1998-01-12  0:00   ` Matthew Heaney
1998-01-12  0:00     ` Brian Rogoff
1998-01-13  0:00       ` Robert Dewar
1998-01-13  0:00         ` Distinguishing type names from other identifiers Nick Roberts
1998-01-13  0:00           ` Matthew Heaney
1998-01-14  0:00             ` Stephen Leake
1998-01-24  0:00               ` Matthew Heaney
1998-01-15  0:00             ` Anonymous
1998-01-24  0:00               ` Matthew Heaney
1998-01-24  0:00                 ` Martin M Dowie
1998-01-25  0:00                   ` Matthew Heaney
1998-01-24  0:00                 ` Martin M Dowie
1998-01-15  0:00           ` Aaro Koskinen
1998-01-17  0:00             ` Martin M Dowie
1998-01-17  0:00               ` Martin M Dowie
1998-01-25  0:00               ` Matthew Heaney
1998-01-25  0:00                 ` Brian Rogoff
     [not found]                 ` <n5rs5FAStOz0Ew2+@dowie-cs.demon.co.uk>
1998-01-26  0:00                   ` Brian Rogoff
1998-01-27  0:00                     ` Martin M Dowie
1998-01-27  0:00                       ` Brian Rogoff
1998-01-27  0:00                         ` Matthew Heaney
1998-01-28  0:00                           ` Brian Rogoff
1998-01-28  0:00                             ` Matthew Heaney
1998-01-29  0:00                               ` Brian Rogoff
1998-01-30  0:00                             ` Mats Weber
1998-01-28  0:00                         ` Martin M Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox