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,52fd60a337c05842 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-15 18:58:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!novia!novia!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3D0BF0B0.44394459@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: ada paper critic References: <3D095F70.8090001@telepath.com> <3D0A3B59.4A4B9E04@acm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 16 Jun 2002 01:58:23 GMT NNTP-Posting-Host: 63.184.0.223 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1024192703 63.184.0.223 (Sat, 15 Jun 2002 18:58:23 PDT) NNTP-Posting-Date: Sat, 15 Jun 2002 18:58:23 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:26056 Date: 2002-06-16T01:58:23+00:00 List-Id: Robert A Duff wrote: > > Jeffrey Carter writes: > > > This seems to be an incomplete sentence. If I interpret it correctly, > > the Ada intent is that the information be carried primarily by the > > exception name. You should not be using a single exception and > > differentiating between logical exceptions by the information attached > > to that exception. > > The problem with this view is that it forces the designer of an > abstraction to decide on the granularity of exception handling, when > this decision rightly belongs in the hands of the person designing the > *handler*. In fact, different handlers have different requirements: > e.g., one handler might want to handle all I/O errors, whereas another > one might want to handle disk_full_error specially. If the designer of > the abstraction decided to lump all I/O errors under one exception name, > then the fine-grained handler is impossible to write. On the other > hand, if the designer of the abstraction defined many exceptions for > different kinds of I/O errors, then the coarse-grained handler has to > mention them all, which is overly verbose, and unmaintainable, because > there might be a new kind of I/O error invented tomorrow. I disagree. The designer of the abstraction has no choice; he must use fine-grained exceptions so that a client with fine-grained handling needs is not excluded. This is true regardless of whether the language has hierarchical exceptions. However, this is irrelevant to the original post to which I was replying. It claimed that the use of String to attach information to an exception made exceptions in Ada inherently slow. > > Also, exceptions should only be used for exceptional situations, so this > > does not impact normal processing at all. > > I don't see how that's relevant. A bug in exception handling is a bug, > even though exceptions occur only rarely. Again, this was in the context of exceptions impacting execution speed, not of errors. -- Jeff Carter "You cheesy lot of second-hand electric donkey-bottom biters." Monty Python & the Holy Grail