comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff Carter <carter@spam.innocon.com>
Subject: Re: Warning: Religious naming convention discussion :-) [was: assign help!!]
Date: 1997/05/09
Date: 1997-05-09T00:00:00+00:00	[thread overview]
Message-ID: <3373666A.31DFF4F5@spam.innocon.com> (raw)
In-Reply-To: 5kuf1j$17vi@uni.library.ucla.edu


Jay Martin wrote:
> 
> "John G. Volan" <johnvolan@sprintmail.com> writes:
> ...
> >I only wish the original designers of Ada83 had clued into this style
> >from the start.  I find myself wishing Ada95 looked more like this:
> 
> >    Integer   : Integer_Type;
> >    Natural   : Natural_Type;
> >    Float     : Float_Type;
> >    Boolean   : Boolean_Type;
> >    Character : Character_Type;
> >    String    : String_Type;
> >    Duration  : Duration_Type;
> >    ...
> 
> Two thumbs up!
> 
> In fact wouldn't be cool if Ada forced all types to have "_Type" suffixes.
> Heh probably make those C hackers blood boil.
> 
> Jay

According to my religion, you guys are heretics. I will give the command
to my followers that you should be killed on sight. Now, if I only had
some followers ...

The problem with putting _Type on the end of all [sub]type names is that
it adds no information. Almost all uses of type names make it obvious
that the name is a type. So all you're doing is putting something on the
end to have a different name for the type, and preserve the name for use
by an object or, more typically, a subprogram parameter. So why not use
the shortest possible suffix, 2 characters: _T? Because it's ugly. But
it wastes fewer characters than the equally ugly _Type.

The only advantage of this approach is that it's a suffix, which is much
better than a prefix. In distinguishing two words, the initial
characters are the most important. Two words that are the same in the
initial characters and differ only in the later characters are more
likely to be confused than two words that differ in the first character.
Thus, the Booch school of prefixing all objects and parameters with The_
is an abomination.

Now, allow me to indoctrinate you into the one true religion. Like you,
I want to preserve the meaningful name (List, Queue, What_Ever) for use
by objects and parameters. Unlike you, I insist that suffixes add at
least some information. So I want my suffix to indicate what kind of
type we're dealing with, as well as differentiating the type name. I use
many; here are a few:

Numeric types: _Value, _Count, _Range

Enumeration types: _Id, _Name

Array types: _Set, _List

Record types: _Group, _Data, _Info

Task types: _Agent, _Controller

Private types: _Handle

I'm also creative in my use of parameter names, using Into, Before,
After, From, To, and so on to avoid as much of this as I can:

procedure Insert (Into : in out String; Before : in Positive; Value : in
String);

procedure Append (Onto : in out List_Handle; After : in Position; Item :
in Element);

However, List_Handle is probably a protected type, so instead we can
write

List.Append (After : in Position, Item : in Element);

Continue in your heresy, and we will burn you alive. Convert, and we
will merely behead you.

Ha! Nobody expects the Sappish Inquisition!
-- 
Jeff Carter  PGP:1024/440FBE21
Auntie-spam reply to; try ( carter @ innocon . com )
"Now go away, or I shall taunt you a second time."
Monty Python & the Holy Grail




  reply	other threads:[~1997-05-09  0:00 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-05  0:00 assign help!! Ivan Gou
1997-05-06  0:00 ` Michael F Brenner
1997-05-07  0:00   ` Charles H. Sampson
1997-05-08  0:00     ` Warning: Religious naming convention discussion :-) [was: assign help!!] John G. Volan
1997-05-09  0:00       ` Jay Martin
1997-05-09  0:00         ` Jeff Carter [this message]
1997-05-09  0:00           ` John G. Volan
1997-05-10  0:00             ` Robert Dewar
1997-05-10  0:00               ` John G. Volan
1997-05-11  0:00                 ` Robert Dewar
1997-05-12  0:00                   ` John G. Volan
1997-05-12  0:00                   ` Robert I. Eachus
1997-05-13  0:00                     ` John G. Volan
1997-05-13  0:00                     ` Robert Dewar
1997-05-16  0:00                       ` Robert I. Eachus
1997-05-17  0:00                         ` Robert Dewar
1997-05-11  0:00               ` Kevin Cline
1997-05-11  0:00                 ` Robert Dewar
1997-05-12  0:00                   ` John G. Volan
1997-05-12  0:00                     ` Robert Dewar
1997-05-16  0:00                 ` Wayne Magor
1997-05-16  0:00                   ` John G. Volan
1997-05-16  0:00                   ` Robert Dewar
1997-05-18  0:00                     ` Nick Roberts
1997-05-20  0:00                     ` naming convention discussion Peter Hermann
1997-05-14  0:00               ` Warning: Religious naming convention discussion :-) [was: assign help!!] Ben Brosgol
1997-05-14  0:00                 ` naming convention: trailing underscore Peter Hermann
1997-05-14  0:00                   ` John G. Volan
1997-05-15  0:00                   ` Michael F Brenner
     [not found]                 ` <dewar.863717431@merv>
1997-05-16  0:00                   ` naming convention discussion Peter Hermann
1997-05-16  0:00                     ` Robert Dewar
1997-05-20  0:00                       ` Peter Hermann
1997-05-16  0:00                   ` Warning: Religious naming convention discussion :-) [was: assign help!!] Robert A Duff
1997-05-18  0:00                     ` Underscores in identifiers (was: Warning: Religious naming convention discussion :-) Ben Brosgol
1997-05-17  0:00                   ` Warning: Religious naming convention discussion :-) [was: assign help!!] Arthur Schwarz
1997-05-17  0:00                     ` Robert Dewar
1997-05-17  0:00                       ` John G. Volan
1997-05-18  0:00                         ` Andrew Dunstan
1997-05-18  0:00                           ` Nick Roberts
1997-05-19  0:00                             ` John G. Volan
1997-05-19  0:00                             ` John G. Volan
1997-05-10  0:00             ` Kaz Kylheku
1997-05-10  0:00               ` John G. Volan
1997-05-10  0:00             ` Aaron Metzger
1997-05-11  0:00               ` Simon Wright
1997-05-11  0:00               ` Robert Dewar
1997-05-11  0:00                 ` John G. Volan
1997-05-11  0:00                 ` Robert A Duff
1997-05-12  0:00                   ` Robert Dewar
1997-05-12  0:00                     ` Robert A Duff
1997-05-12  0:00                       ` Robert Dewar
1997-05-13  0:00                         ` David L Brown
1997-05-13  0:00                           ` W. Wesley Groleau (Wes)
1997-05-14  0:00                           ` Robert Dewar
1997-05-13  0:00                         ` Robert A Duff
1997-05-13  0:00                           ` Robert Dewar
1997-05-14  0:00                             ` Ole-Hjalmar Kristensen FOU.TD/DELAB
1997-05-13  0:00                           ` Kaz Kylheku
1997-05-14  0:00                             ` Robert A Duff
1997-05-14  0:00                             ` Kevin Cline
1997-05-14  0:00                               ` Robert Dewar
1997-05-12  0:00                 ` Kaz Kylheku
1997-05-12  0:00               ` John G. Volan
1997-05-12  0:00             ` Jeff Carter
1997-05-12  0:00               ` John G. Volan
1997-05-12  0:00             ` W. Wesley Groleau (Wes)
1997-05-12  0:00               ` John G. Volan
1997-05-13  0:00                 ` W. Wesley Groleau (Wes)
1997-05-13  0:00                   ` John G. Volan
1997-05-14  0:00                     ` naming convention discussion Peter Hermann
1997-05-14  0:00                       ` John G. Volan
1997-05-14  0:00                         ` Peter Hermann
1997-05-14  0:00                           ` John G. Volan
1997-05-15  0:00                             ` Peter Hermann
1997-05-15  0:00                           ` W. Wesley Groleau (Wes)
1997-05-14  0:00                     ` Warning: Religious naming convention discussion :-) [was: assign help!!] Do-While Jones
1997-05-14  0:00                       ` John G. Volan
1997-05-14  0:00                         ` John G. Volan
1997-05-15  0:00                         ` Tangent to Religious naming convention discussion W. Wesley Groleau (Wes)
1997-05-15  0:00                           ` John G. Volan
1997-05-14  0:00                       ` Warning: Religious naming convention discussion :-) [was: assign help!!] Stephen Leake
1997-05-09  0:00           ` John G. Volan
1997-05-10  0:00           ` Robert Dewar
1997-05-10  0:00             ` John G. Volan
1997-05-11  0:00               ` Robert Dewar
1997-05-12  0:00                 ` John G. Volan
1997-05-12  0:00               ` W. Wesley Groleau (Wes)
1997-05-12  0:00             ` W. Wesley Groleau (Wes)
1997-05-12  0:00               ` John G. Volan
1997-05-11  0:00           ` Doug Smith
1997-05-12  0:00           ` Tom Moran
1997-05-16  0:00           ` Wayne Magor
1997-05-16  0:00             ` John G. Volan
1997-05-17  0:00             ` Kevin Cline
1997-05-19  0:00               ` Doug Smith
1997-05-09  0:00         ` John G. Volan
1997-05-09  0:00       ` Kevin Cline
1997-05-09  0:00         ` John G. Volan
1997-05-12  0:00       ` W. Wesley Groleau (Wes)
1997-05-12  0:00         ` John G. Volan
1997-05-12  0:00         ` John G. Volan
1997-05-10  0:00     ` assign help!! Simon Wright
1997-05-14  0:00       ` Nick Roberts
replies disabled

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