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!news1.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!edtnps89.POSTED!023a3d7c!not-for-mail Sender: blaak@METROID Newsgroups: comp.lang.ada Subject: Re: contracted exceptions References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> From: Ray Blaak Message-ID: Organization: The Transcend User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Jun 2007 17:40:37 GMT NNTP-Posting-Host: 208.66.252.228 X-Trace: edtnps89 1181324437 208.66.252.228 (Fri, 08 Jun 2007 11:40:37 MDT) NNTP-Posting-Date: Fri, 08 Jun 2007 11:40:37 MDT Xref: g2news1.google.com comp.lang.ada:16117 Date: 2007-06-08T17:40:37+00:00 List-Id: Robert A Duff writes: > Ray Blaak writes: > > 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 Well, you are right in theory. The problem is that such naive programmers are directed by the compiler to do something about the exception, and being naive they make this mistake. Training is hard, and this particular problem is unexpectedly pervasive. So, when one realizes that in the majority of cases all that is happening is just an upwards perculation, that in fact the exception checking is not usually needed, the observation is that changing the language design lets quirkly irrational imperfect humans avoid certain errors more readily. What we should strive for in language design are approaches that naturally encourage correct or robust behaviour by default, so that the need for training becomes less of an issue. > You should almost never silently swallow an exception > like that, and if you do, you should always have a comment > explaining why. Absolutely. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.