From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e0afec3ed133afd9 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Enumerations and Arrays Unnecessary!??? Date: 1997/06/14 Message-ID: #1/1 X-Deja-AN: 248356983 References: <33A16AC0.1BA4@calvin.cca.rockwell.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-06-14T00:00:00+00:00 List-Id: In article <33A16AC0.1BA4@calvin.cca.rockwell.com>, JR Crosmer 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