comp.lang.ada
 help / color / mirror / Atom feed
From: robert_dewar@my-dejanews.com
Subject: Re: Printing Enum Variable Re: Linux World
Date: 1999/03/06
Date: 1999-03-06T00:00:00+00:00	[thread overview]
Message-ID: <7brec4$ti2$1@nnrp1.dejanews.com> (raw)
In-Reply-To: Pine.A41.3.96-heb-2.07.990306133205.114882A-100000@pluto.mscc.huji.ac.il


> There is a point of view in the OOP community that says
> that enumeration types arean 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.

It is odd. Every few years, some new group of people
rediscover Church's thesis. They develop a new paradigm
and make the amazing discovery that they can manage to
program any computing problem using this paradigm. They
then conclude that one *ought* to use the paradigm 100%
of the time, some examples are:

  goto-free programming
  top down structured programming
  applicative/functional programming
  data flow programming
  integration of correctness proofs
  logic programming
  ...

and of course, most recently

  object oriented programming

It's really a very puzzling phenomenon. If you step back
and take a broader view, it is amazingly obvious that these
narrow viewpoints are just that, narrow, and that the far
more reasonable viewpoint is that we have a variety of
paradigms, and should use the one, or the mixture that is
appropriate to the problem at hand.

Yes, of course it is problematic to use an enumeration type
if one expects to make frequent changes to the set of
values in a manner that does not really correspond to the
abstraction in the first place. For example, it is a
definite mistake to try to model errno across targets as an
enumeration type, since the set of codes will change
frequently, and it is simply unhelpful to use an
enumeration type in this situation.

On the other hand, complaining about

  type day is (Sun, Mon, Tue, Wed, Thu, Fri, Sat);

on the grounds it does not allow for easy extension is
good only for inclusion in a set of bad jokes.

Extensible types and dynamic dispatching are certainly
useful techniques *some of the time*. If you get into a
way of thinking that ALL variant types and case statements
must be replaced with this approach, you will create a mess
for some problems where the case statements are more
appropriate.

This really is such obvious stuff that it should not need
saying, but I still find that we are beset by fanatics who
are singing the latest "do it my way, it is the only true
way" song!

Robert Dewar

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-03-06  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 Wilson
1999-03-03  0:00       ` David Starner
1999-03-04  0:00         ` Richard D Riehle
1999-03-04  0:00         ` robert_dewar
1999-03-04  0:00         ` Magnus Larsson
1999-03-03  0:00           ` 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-05  0:00                   ` David Botton
1999-03-05  0:00                     ` robert_dewar
1999-03-05  0:00                 ` Larry Kilgallen
1999-03-04  0:00               ` Hans Marqvardsen
1999-03-05  0:00                 ` dewar
1999-03-07  0:00                   ` Hans Marqvardsen
1999-03-03  0:00           ` Printing Enum Variable Re: Linux World (Correction) Hans Marqvardsen
1999-03-04  0:00         ` Printing Enum Variable Re: Linux World Richard D Riehle
1999-03-04  0:00         ` fraser
1999-03-05  0:00           ` Nick Roberts
1999-03-05  0:00             ` fraser
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
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             ` robert_dewar
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                   ` Matthew Heaney
1999-03-08  0:00                     ` Michael Young
1999-03-08  0:00                       ` Matthew Heaney
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                               ` Michael Young
1999-03-10  0:00                                 ` Mike Silva
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                                     ` 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                                     ` Richard D Riehle
1999-03-10  0:00                                     ` Pascal Obry
1999-03-10  0:00                                 ` Pascal Obry
     [not found]                               ` <7c4ru6$e45$1@remarq.com>
1999-03-10  0:00                                 ` fraser
     [not found]                               ` <7 <7c58qa$b6b$1@cf01.edf.fr>
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                       ` Larry Kilgallen
1999-03-08  0:00                         ` robert_dewar
1999-03-08  0:00                       ` Florian Weimer
1999-03-04  0:00           ` Ehud Lamm
1999-03-05  0:00             ` Richard D Riehle
1999-03-05  0:00               ` Nick Roberts
1999-03-06  0:00                 ` Ehud Lamm
1999-03-06  0:00                   ` robert_dewar [this message]
1999-03-06  0:00                     ` Ehud Lamm
1999-03-06  0:00                     ` Larry Kilgallen
1999-03-06  0:00                       ` Dave Taylor
1999-03-06  0:00                         ` Bruce or Tracy
replies disabled

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