comp.lang.ada
 help / color / mirror / Atom feed
From: JR Crosmer <jrc@calvin.cca.rockwell.com>
Subject: Enumerations and Arrays Unnecessary!???
Date: 1997/06/13
Date: 1997-06-13T00:00:00+00:00	[thread overview]
Message-ID: <33A16AC0.1BA4@calvin.cca.rockwell.com> (raw)


In the past six months I have a course in object oriented design and
another one in object oreinted design (5-days each) .  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.  They each suggested that an
enumeration litteral be thought of as an object: e.g., send a message to
the color Red to do something.  Thay also insisted that in any
situations in which an array is used, the implementation is not a good
fit to the underlying problem.

In my experience, I would be very hard pressed to give up either 
enumerations or arrays, especially with the capabilities allowed
and enhanced with Ada attributes and data typing rules.

In contrast, in C, C++ or Java, enumerations have almost no capability
since they are treated mostly as named integers w/respect to name space
and type compatibility.  In particular, these languages are especially
barren when trying to code a situation such as this one:

    type Color_Type is (Red, Green, Blue);
 
    type Color_Vector_Type is
            array (Color_Type) of ...some-element-type....;

Any thoughts from other Ada, C++ or Jave programmers?

JR Crosmer




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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 JR Crosmer [this message]
1997-06-14  0:00 ` Enumerations and Arrays Unnecessary!??? Robert A Duff
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