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/15
Date: 1998-01-15T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.3.96.980115115538.6443A-100000@shell5.ba.best.com> (raw)
In-Reply-To: 69kf9b$fjr@drn.zippo.com


On 14 Jan 1998 nabbasi@earthlink.net wrote:
> In POSIX threads, types are named with a trailing "_t", as in
> 
>                 pthread_mutex_t
> 
> I found this to be clear and I like it, a little "_t" at the end is not much
> extra overhead on the eye. 

I share your opinion, though I don't find "_Type" too bad either. 

The most important rule I follow is the "grandfather clause", and that is
that if the code I am maintaining/modifying/whatever (how many of times do 
you get to start at the very beginning?) uses some set of conventions, I
strive to be consistent with them, even if I find them personally
repugnant (like the plurals for types convention), so that the code has 
the appearance of being written by one person adhering to a single set 
of conventions. 
  
> my final 2 cents is that a trailing "_t" in Ada would be a good choice 
> for a type name, I think "_type" is an overkill, and too much extra typing,
> but I prefer to see "_type" than nothing at all in the type name.

As you can see from all of the postings on this, there are quite a few
diverging opinions. It reminds me of the intense arguments over brace
placement in C. As long as only one convention is used throughout a
project, I don't have too many problems switching over.
 
> Other conventions I use in my C++/Java programming is to use "m_" as the
> start of a variable name that is local to a class, this I find helps me
> when I am reading code to get a better feeling where things live without
> having to go look for them in the code. 

Doug Lea has a pretty decent Java coding standard available at his home
page, which addresses issues like these. 

-- Brian






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

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-14  0:00 Distinguishing type names from other identifiers 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 [this message]
  -- 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-13  0:00 Adam Beneschan
1998-01-14  0:00 ` Brian Rogoff
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-21  0:00           ` Philip Brashear
1998-01-20  0:00         ` Benoit Jauvin-Girard
1998-01-20  0:00           ` Robert Dewar
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