comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Distinguishing type names from other identifiers
Date: 1998/01/25
Date: 1998-01-25T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680002501980906220001@news.ni.net> (raw)
In-Reply-To: 6v0LMGAjwIw0Ews0@dowie-cs.demon.co.uk


In article <6v0LMGAjwIw0Ews0@dowie-cs.demon.co.uk>, Martin M Dowie
<martin@dowie-cs.demon.co.uk> wrote:

>...how do people feel about prefixing types with 'A_' or 'An_'? the
>theory is that should you wish a function to return something of this
>type you just 'A_/An_'. It also reads a little more english-like than
>'_type'/'_t', although i've never really thought that 'for this_index in
>a_something loop' etc. was particularly like any english i've ever
>heard...
>
>it kind of ties in with an OO-mentality too, as (talking Ada83 here) we
>are using types to build classes, and data objects for
>objects/instances. having a general name for a type helps get this over.

Be consistant with the style used in the RM.  If you ever have a question
about how to name something, then flip through the RM (or ask me :-) to see
how the RM does it, and name it that way.  Don't make up a convention
because you think it's more "oo-like."

So the answer is: No, do not use the indefinate article to name types or
objects.  That convention does not appear in the RM, so its use in your
code would be inconsistant with the RM.

The reason we Ada programmers even have this debate about the _Type
convention, is because the file type in Text_IO was named File_Type.  Had
the designers named it Text_File, which is how the abstraction is described
in the Rationale (see Text Files, Section 16.5; see also Indexed and
Sequential Files, section 16.4), we wouldn't be having this debate at all,
and very likely it wouldn't have even occurred to anyone to use _Type for
type names.

This is the argument against _Type as a suffix.  Because it's a noise word,
it doesn't add any new information.  If you have to type something, then
you might as well type something that adds meaning.  I would have prefered
that the I/O types been named

Text_File instead of Text_IO.File_Type

Indexed_File instead of Direct_IO.File_Type 

Sequential_File instead of Sequential_IO.File_Type

This convention exactly corresponds to the description in the Rationale.

--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271




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

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-07  0:00 Two simple language questions Chip Richards
1998-01-07  0:00 ` Tucker Taft
1998-01-07  0:00 ` Robert Dewar
1998-01-07  0:00 ` Matthew Heaney
1998-01-10  0:00   ` Two simple language questions (plural types) Michael F Brenner
1998-01-10  0:00     ` Robert Dewar
1998-01-10  0:00       ` Matthew Heaney
1998-01-10  0:00         ` Robert Dewar
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-24  0:00                         ` Martin M Dowie
1998-01-24  0:00                           ` Pred Nick Roberts
1998-01-25  0:00                           ` Distinguishing type names from other identifiers Matthew Heaney
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 [this message]
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
1998-01-12  0:00           ` Two simple language questions (plural types) Brian Rogoff
1998-01-11  0:00     ` Brian Rogoff
1998-01-07  0:00 ` Two simple language questions Dale Stanbrough
  -- strict thread matches above, loose matches on Subject: below --
1998-01-13  0:00 Distinguishing type names from other identifiers 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             ` Brian Rogoff
1998-01-17  0:00               ` nabbasi
1998-01-18  0:00                 ` Robert Dewar
1998-01-16  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-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-25  0:00 tmoran
1998-01-25  0:00 ` Brian Rogoff
1998-01-26  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