comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Enumerations and Arrays Unnecessary!???
Date: 1997/06/14
Date: 1997-06-14T00:00:00+00:00	[thread overview]
Message-ID: <EBrsxr.JrJ@world.std.com> (raw)
In-Reply-To: 33A16AC0.1BA4@calvin.cca.rockwell.com


In article <33A16AC0.1BA4@calvin.cca.rockwell.com>,
JR Crosmer  <jrc@calvin.cca.rockwell.com> wrote:
>In the past six months I have a course in object oriented design and
>another one in object oreinted design (5-days each) .

Heh?

>...In each course
>the instructor insisted rather stronly that "There is no need for
>enumeration types or array types."  Neither instructor had any
>familiarity with Ada83 or Ada95. ...

It's true that many uses of enumerations can be replaced with oop-ish
things.  If, in Ada 83, your enumeration type was the discriminant of a
variant record, then in Ada 95 a hierarchy of tagged types might be
appropriate instead.

But to say that enums are *never* a good idea seems silly.  For example,
consider type Character, which is an enumeration type.

As for arrays: It is true that arrays are often too low-level a feature.
You should use a Set or Sequence or Unbounded_String or whatever
abstraction instead.  But, you'll *implement* those abstractions in
terms of arrays, in many cases.

You say the professor didn't know Ada.  So perhaps the professor was
thinking of C, where enums are weaker, characters and integers are
confused, and the point about arrays is even *more* true since C arrays
are even lower level abstractions than Ada's arrays.

- Bob




  reply	other threads:[~1997-06-14  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 Enumerations and Arrays Unnecessary!??? JR Crosmer
1997-06-14  0:00 ` Robert A Duff [this message]
1997-06-14  0:00   ` Robert Dewar
1997-06-18  0:00     ` Nick Roberts
1997-06-18  0:00       ` Robert A Duff
1997-06-14  0:00 ` Robert Dewar
1997-06-16  0:00   ` Fanaticism [was Re: Enumerations and Arrays Unnecessary!???] Jan Galkowski
1997-06-16  0:00 ` Enumerations and Arrays Unnecessary!??? David Wheeler
replies disabled

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