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,7d3cb5920e882220 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: Exceptions References: <5947aa62-2547-4fbb-bc46-1111b4a0dcc9@x69g2000hsx.googlegroups.com> <475c6ed8$0$13111$9b4e6d93@newsspool2.arcor-online.net> <1kxk3hlfa25dw$.fl2wvbn0tpbg$.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, 14 Dec 2007 00:53:00 GMT NNTP-Posting-Host: 208.66.252.228 X-Trace: edtnps89 1197593580 208.66.252.228 (Thu, 13 Dec 2007 17:53:00 MST) NNTP-Posting-Date: Thu, 13 Dec 2007 17:53:00 MST Xref: g2news1.google.com comp.lang.ada:18935 Date: 2007-12-14T00:53:00+00:00 List-Id: "Randy Brukardt" writes: > Once you have unchecked exceptions, the contract really doesn't tell you > anything interesting (since it is the propagation of predefined exceptions > that usually lead to bugs; only the rare case where the predefined exception > is caught will tell you anything at all). Even with checked exceptions the contract still doesn't help, since unchecked exceptions are always possible in one form or another (e.g. allocation failures, program errors, truly unexpected failures). You can't just die. > Moreover, the temptation is overwhelming to use the unchecked kind > everywhere, because it is less hassle and the checked kind doesn't buy that > much anyway (it doesn't guarentee that all exceptions are handled, but only > the rare few that are declared checked). I see nothing wrong with following that temptation. Following that temptation saves time. Basically, the effort at trying to statically prove that all exceptions are handled is a waste of time. Even if the language supports checked exceptions, unchecked ones can still leak through. Having a sort of "unexpected exception" policy let's you catch any surprises reasonable, and you can always go back and tweak the code to handle any specific ones better should that prove necessary. -- 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.