comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Printing Enum Variable Re: Linux World
Date: 1999/03/05
Date: 1999-03-05T14:31:58-06:00	[thread overview]
Message-ID: <7bpevu$frn@dfw-ixnews12.ix.netcom.com> (raw)
In-Reply-To: Pine.A41.3.96-heb-2.07.990304174949.28402A-100000@pluto.mscc.huji.ac.il

In article <Pine.A41.3.96-heb-2.07.990304174949.28402A
100000@pluto.mscc.huji.ac.il>,
	Ehud Lamm <mslamm@mscc.huji.ac.il> wrote:

in reference to Ada enumeration types,

>Time and again I am amazed how this simple festure ofthe language stumps
>people. I see exercises which show understanding of important and
>difficult concepts like genericity - but fail to exploit enumeration type
>where appropriate. This should really end up on my idiom list. 

 Enumeration types also carry the potential for abuse.  I recall
 a programmer who had a package specification with an enumeration
 type where the set of values spanned three pages of source code.

 If enumeration types are to be on the idiom list, they should be 
 accompanied by a set of guidelines.  One of the problems we are 
 trying to solve with object-oriented programming and child library
 units is the extension of existing code without performing "open
 heart surgery" on it.  Heavy use of enumeration types can result in
 cracking open existing code to perform such extensions.

 Some of the guidelines I follow, and counsel my clients to follow,
 1) only use enumeration types when there is a well-known limit to the
 set of values.  2) Use them when there is a clear requirement for an
 ordered set, 3) Use them for identifying types that have a small
 set of values (e.g., Location is (Front, Back);).

 There is a point of view in the OOP community that says that enumeration
 types are an artifact of an obsolete style of programming.  That is,
 an enumeration type, because it is not extensible and cannot be
 further specialized, is antithetical to OOP.  Although I find this 
 viewpoint a little too narrow for my taste, one could make a very 
 good case to support it in many situations.

 Richard Riehle
 richard@adaworks.com
 http://www.adaworks.com




  reply	other threads:[~1999-03-05  0:00 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-02  0:00 Linux World Richard D Riehle
1999-03-02  0:00 ` fraser
1999-03-02  0:00   ` Printing Enum Variable " David Starner
1999-03-03  0:00     ` fraser
1999-03-03  0:00       ` David Starner
1999-03-03  0:00         ` Samuel T. Harris
1999-03-03  0:00         ` fraser
1999-03-04  0:00         ` dennison
1999-03-04  0:00           ` Ehud Lamm
1999-03-04  0:00         ` robert_dewar
1999-03-03  0:00           ` David Starner
1999-03-04  0:00             ` Samuel Mize
1999-03-04  0:00               ` Samuel Mize
1999-03-05  0:00                 ` Robert A Duff
1999-03-05  0:00               ` Robert A Duff
1999-03-07  0:00               ` Florian Weimer
1999-03-07  0:00                 ` Michael Young
1999-03-07  0:00                   ` Larry Kilgallen
1999-03-07  0:00                     ` Michael Young
1999-03-08  0:00                       ` robert_dewar
1999-03-08  0:00                         ` Richard D Riehle
1999-03-09  0:00                           ` Michael Young
1999-03-09  0:00                             ` Larry Kilgallen
1999-03-09  0:00                               ` billy
1999-03-10  0:00                                 ` robert_dewar
1999-03-10  0:00                                   ` Dale Stanbrough
1999-03-10  0:00                                     ` Pascal Obry
1999-03-10  0:00                                     ` Richard D Riehle
1999-03-10  0:00                                     ` dennison
1999-03-10  0:00                                       ` bob
1999-03-10  0:00                                         ` Mike Silva
1999-03-10  0:00                                           ` dennison
1999-03-10  0:00                                           ` Nick Roberts
1999-03-10  0:00                                 ` Pascal Obry
1999-03-09  0:00                               ` Michael Young
1999-03-10  0:00                                 ` Mike Silva
     [not found]                               ` <7 <7c58qa$b6b$1@cf01.edf.fr>
1999-03-10  0:00                                 ` fraser
     [not found]                               ` <7c4ru6$e45$1@remarq.com>
1999-03-10  0:00                                 ` fraser
     [not found]                             ` <1999Mar9.131659. <dale-1003991644340001@r1021c-07.ppp.cs.rmit.edu.au>
1999-03-10  0:00                               ` Larry Kilgallen
1999-03-08  0:00                       ` Florian Weimer
1999-03-08  0:00                       ` Larry Kilgallen
1999-03-08  0:00                         ` robert_dewar
1999-03-07  0:00                   ` Matthew Heaney
1999-03-08  0:00                     ` Michael Young
1999-03-08  0:00                       ` Matthew Heaney
1999-03-04  0:00             ` robert_dewar
1999-03-04  0:00           ` Ehud Lamm
1999-03-05  0:00             ` Richard D Riehle [this message]
1999-03-05  0:00               ` Nick Roberts
1999-03-06  0:00                 ` Ehud Lamm
1999-03-06  0:00                   ` robert_dewar
1999-03-06  0:00                     ` Larry Kilgallen
1999-03-06  0:00                       ` Dave Taylor
1999-03-06  0:00                         ` Bruce or Tracy
1999-03-06  0:00                     ` Ehud Lamm
1999-03-03  0:00     ` Larry Kilgallen
1999-03-03  0:00       ` Nick Roberts
1999-03-03  0:00         ` David Starner
1999-03-03  0:00     ` Fraser Wilson
1999-03-03  0:00       ` David Starner
1999-03-04  0:00         ` robert_dewar
1999-03-04  0:00         ` Richard D Riehle
1999-03-04  0:00         ` Magnus Larsson
1999-03-03  0:00           ` Printing Enum Variable Re: Linux World (Correction) Hans Marqvardsen
1999-03-03  0:00           ` Printing Enum Variable Re: Linux World Hans Marqvardsen
1999-03-04  0:00             ` Nick Roberts
1999-03-04  0:00             ` robert_dewar
1999-03-04  0:00               ` Hans Marqvardsen
1999-03-05  0:00                 ` dewar
1999-03-07  0:00                   ` Hans Marqvardsen
1999-03-04  0:00               ` Hans Marqvardsen
1999-03-05  0:00                 ` dewar
1999-03-05  0:00                   ` David Botton
1999-03-05  0:00                     ` robert_dewar
1999-03-05  0:00                 ` Larry Kilgallen
1999-03-04  0:00         ` fraser
1999-03-05  0:00           ` Nick Roberts
1999-03-05  0:00             ` fraser
1999-03-04  0:00         ` Richard D Riehle
replies disabled

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