comp.lang.ada
 help / color / mirror / Atom feed
* Enumerations and Arrays Unnecessary!???
@ 1997-06-13  0:00 JR Crosmer
  1997-06-14  0:00 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: JR Crosmer @ 1997-06-13  0:00 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1997-06-18  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-13  0:00 Enumerations and Arrays Unnecessary!??? JR Crosmer
1997-06-14  0:00 ` Robert Dewar
1997-06-16  0:00   ` Fanaticism [was Re: Enumerations and Arrays Unnecessary!???] Jan Galkowski
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-16  0:00 ` David Wheeler

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