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-Thread: 103376,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.germany.com!news.belwue.de!th!lucks From: Stefan Lucks Newsgroups: comp.lang.ada Subject: Re: contracted exceptions Date: Fri, 8 Jun 2007 17:56:36 +0200 Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Message-ID: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> NNTP-Posting-Host: th.informatik.uni-mannheim.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: news.BelWue.DE 1181318199 5552 134.155.91.85 (8 Jun 2007 15:56:39 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Fri, 8 Jun 2007 15:56:39 +0000 (UTC) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:16113 Date: 2007-06-08T17:56:36+02:00 List-Id: On Fri, 8 Jun 2007, Robert A Duff wrote: > Ray Blaak writes: > >> The Java experience shows that compiler checked exception specifications don't >> work. > >> A typical naive programmer, forced by the compiler to handle an exception, >> overwhelmingly seems to do: > ... >> or even worse: >> >> try >> { >> doSomething(); >> } >> catch (SomeError e) >> { >> } > > Well, this part of the problem can't be blamed on the language. > This code is just plain bad practise. The solution is better > training for programmers, not better language design: > You should almost never silently swallow an exception > like that, and if you do, you should always have a comment > explaining why. Unfortunately, this is what Ada tasks implicitely do. If a task fails to handle an exception raised somewhere inside, the task silently dies -- without notifying anyone. Enforcing the subprograms used by the task to precisely specify "this subprogram might raise these exceptions and none else" would help a lot ... -- Stefan Lucks (moved to Bauhaus-University Weimar, Germany) ------ I love the taste of Cryptanalysis in the morning! ------