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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: contracted exceptions Date: Sat, 09 Jun 2007 13:32:59 +0100 Organization: Pushface Message-ID: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> <1it2vtizha2fi$.jxnoaxmm9sop$.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1181392381 7673 62.49.19.209 (9 Jun 2007 12:33:01 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 9 Jun 2007 12:33:01 +0000 (UTC) Cancel-Lock: sha1:fFYaPOHgDl9Qnh4j190OR0Hn800= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (darwin) Xref: g2news1.google.com comp.lang.ada:16134 Date: 2007-06-09T13:32:59+01:00 List-Id: "Dmitry A. Kazakov" writes: > On Fri, 08 Jun 2007 20:15:03 +0100, Simon Wright wrote: > >> "Dmitry A. Kazakov" writes: >> >>> Software and more narrowly exceptions cannot report own bugs. It >>> would be a very bad idea to exceptions for that, because vital >>> information about the reasons will be inevitably destroyed. The best >>> possible way is to break into debugger, stopping everything else. >> >> I don't really understand the first sentence of this .. > > When the program has a bug, then it could be anything, including > reporting another or non-existing bug, raising exceptions (false > positive), not raising exception (false negative), whatever. > > Let the probability of a program state where it would have a false > positive be sufficiently greater than the probability of the states > with false negative. Then it is better not to report anything! > > What is known about these probabilities? Not a lot .. an exception is raised because some assertion made by the designer/implementer of the library concerned has turned out to be false (the value will be in this range; the file will be open; the file is a valid XML document ...). If I can find out which of my assumptions failed, I have at least somewhere to start. I agree that an exception message isn't of any use to the end user (I suppose they may grow to learn that some messages happen because of particular sequences of operations, and to avoid those sequences).