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,319ef0454c7765d5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-28 13:25:18 PST Path: nntp.gmd.de!stern.fokus.gmd.de!ceres.fokus.gmd.de!zib-berlin.de!Germany.EU.net!wizard.pn.com!sundog.tiac.net!jdi.tiac.net!ichbiah From: ichbiah@jdi.tiac.net (Jean D. Ichbiah) Newsgroups: comp.lang.ada Subject: Re: Why no exception hierarchy ? Date: Tue, 28 Mar 1995 18:15:53 GMT Organization: JDI Technology, Inc. Message-ID: References: <3ksv4s$f9e@news.uni-c.dk> <3l1mgn$ppb@gnat.cs.nyu.edu> NNTP-Posting-Host: jdi.tiac.net X-Newsreader: Trumpet for Windows [Version 1.0 Rev B] Date: 1995-03-28T18:15:53+00:00 List-Id: In article <3l1mgn$ppb@gnat.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) writes: >The overuse of exceptions, and in particular the over specification of >fine distinctions in exceptions is a common design error in Ada programs, >which would no doubt be encouraged by a fancier exception mechanism. >For example, in one early version of the Posix interface, every error >condition was mapped into a separate exception, but it becamse clear that >it is much better to have a single exception with an error code. >When Jean considered this particular point (the Posix point), he wondered >to me whether perhaps a better language design would have been to have only >one exception with an error code ... Well said Robert. In the Ada design (83) I spent several years reducing the 18 or so exceptions of preliminary Green to the 5 of Ada. I tried to convince others to reduce it to one but was not convincing enough. The logic for one is that there is not much you con do most of the time with the knowledge of which exception. You do know the current process failed. But usually you do not have much information on where it failed. So the only thing that matters is that you have to provide a replacement solution. The only proper way to be really sure of where an exception occurs is to corner it within a narrow block (begin ... exception ... end) and once you do this, the name of the exception does not matter much, nor does the error code. Jean D. Ichbiah