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!news3.google.com!news.germany.com!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sun, 09 Dec 2007 23:40:20 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Exceptions References: <5947aa62-2547-4fbb-bc46-1111b4a0dcc9@x69g2000hsx.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <475c6ed8$0$13111$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 09 Dec 2007 23:40:24 CET NNTP-Posting-Host: 5a33b6b9.newsspool2.arcor-online.net X-Trace: DXC=>@InIH7=O5<_A0jCfgHO6>A9EHlD;3Yc24Fo<]lROoR14nDHegD_]R5To`k>>31Z;:A:ho7QcPOV3`FjEjgb8_;93Zn Robert A Duff wrote: > Simon Wright writes: > >> I think this would be a very bad idea. I don't want to be forced to >> deal with the exception 'here' when it would be better handled by my >> caller. > > But this would only apply to some exceptions. If you don't want to be > "forced", use an unchecked exception. > > I think there are some mistakes in the Java design for exceptions, but I > don't think the whole idea of exception contracts is bad. > > - Bob When Robert Dewar talked about exceptions at MIT (I think, that's from memory of a video recording), one of his arguments was that you don't want to write cascades of conditionals for handling return values (being either returned values or failure indicators) ---because that's a mess. Now, when we have a sequence of statements in a block, P1(X); P2(X); ... ; Pn(X, Y); then what will be the average number of exception handlers for this block? Involving how many different exceptions? We would soon arrive at a complicated roughly O(N) size comb of exception choices and Pk-exceptions covered in each handler. Each handler possibly involving conditionals for Pk's and Pj's. I see this as a likely consequence once Ada people start trying to formally cover the exceptional. How would that be an improvement and not just the return code mess again? (And it smells of using state machines to once again try to apply AI to things we didn't think of.)