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=0.2 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, XPRIO_SHORT_SUBJ autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,78b2880bc7e78e39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-19 08:56:10 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!isdnet!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: RISC Date: Mon, 19 Mar 2001 11:45:44 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <995d4b$mts$1@nh.pace.co.uk> References: <98tt7g$88h$1@nh.pace.co.uk> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 985020363 23484 136.170.200.133 (19 Mar 2001 16:46:03 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 19 Mar 2001 16:46:03 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: supernews.google.com comp.lang.ada:5852 Date: 2001-03-19T16:46:03+00:00 List-Id: Good points made here. That's kind of why I observed that it is more of an "art" than a "science". If an engineer has a good sense of what exceptions are for and how they should be used, he's likely to do a good job with their usage. However, there aren't a bunch of clear cut rules to apply that always guide you to proper use of exceptions. I suspect it would be easier to write a set of rules for proper usage of the goto statement than it would be to write rules for exceptions. Start with "never" and then add the handful of cases where it makes sense as exceptions to the "never" rule. I can't quite get to the same point with exceptions.... (But how's *that* for flame bait? :-) MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Robert A Duff" wrote in message news:wcczoek12ur.fsf@world.std.com... > Which leaves open the definition of "error". Different folks have > different notions of error. > > I think the point of exceptions is that whether a given condition is an > "error" depends on your point of view. Eg, a data structure package > that has a Remove_Item operation: if the data structure is empty, that's > an error, and an exception is appropriate. But from the point of view > of the client, this situation might be "normal" or might be a bug -- > it's the programmer's choice. > > Another way to look at it is that the point of exceptions is to separate > the code that *detects* errors from the code that *handles* those > situations. If the code that detects something knows what to do about > it, then exceptions aren't necessary -- that code can just have an 'if' > statement that checks the condition, and handles the situation in the > 'then' part. > > - Bob