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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a04e500922557815 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 11:00:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!paloalto-snh1.gtei.net!lsanca1-snf1!news.gtei.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3CE2A23D.850BA244@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Need advice: Enumerate or not References: <3CE2540C.1030404@worldnet.att.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 15 May 2002 18:00:35 GMT NNTP-Posting-Host: 63.184.17.94 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1021485635 63.184.17.94 (Wed, 15 May 2002 11:00:35 PDT) NNTP-Posting-Date: Wed, 15 May 2002 11:00:35 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:24107 Date: 2002-05-15T18:00:35+00:00 List-Id: Jim Rogers wrote: > > The use of enumerated types is clearly more of an Ada 83 design > pattern. Its limitation is that you must update the source code > for the Update procedure when new options are permitted. > > The use of dispatching is clearly more of an Ada 95 design > pattern. Its main advantage is that you never need to change > the Update procedure taking a parameter of type > "access Gtk_Frame_Record'Class". All you need to do is override the > Update procedure for the new child type of Gtk_Frame_Record. > > The Ada 95 approach is perhaps harder to read, because all the > decisions are performed by dispatching and not by explicit > branching in your code. To summarize, enumeration types are easier to read but require writing more code. Dispatching (OOP) is harder to read but requires less coding. Ada has as an explicit design goal of emphasizing ease of reading over ease of writing. Thus Rogers' statements support the claim that dispatching is not in the spirit of Ada. -- Jeff Carter "Go and boil your bottoms." Monty Python & the Holy Grail