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!news3.google.com!out02a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!newsfeed.yul.equant.net!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: contracted exceptions Date: Fri, 08 Jun 2007 08:10:21 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1181304621 26997 192.74.137.71 (8 Jun 2007 12:10:21 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 8 Jun 2007 12:10:21 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:oAFIKvsUoaJxBHG4l+fCrq9yFmE= Xref: g2news1.google.com comp.lang.ada:16108 Date: 2007-06-08T08:10:21-04:00 List-Id: 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. I've seen the same thing (rarely) in Ada code, too. - Bob