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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5af5c381381ac5a7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feed.xsnews.nl!border-1.ams.xsnews.nl!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada requires too much typing! Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4c0013dc$0$6992$9b4e6d93@newsspool4.arcor-online.net> Date: Fri, 28 May 2010 21:39:28 +0200 Message-ID: <9zi20cpx8981.1k41pl2rxr4en$.dlg@40tude.net> NNTP-Posting-Date: 28 May 2010 21:39:22 CEST NNTP-Posting-Host: 0f0c1b82.newsspool3.arcor-online.net X-Trace: DXC=YQ?1b?4ekK_E47KDAk81NWMcF=Q^Z^V3X4Fo<]lROoRQ8kF On Fri, 28 May 2010 21:05:00 +0200, Georg Bauhaus wrote: > On 28.05.10 19:31, Dmitry A. Kazakov wrote: >> On Fri, 28 May 2010 11:52:09 -0400, John B. Matthews wrote: >> >>> In Java, the presence of a suitable handler for checked exceptions is >>> enforced at compile-time: >>> >>> >>> >>> The feature may be regarded as controversial: >>> >>> >> >> BTW, this is the same issue as with Eiffel's "contracts" and Ada's >> assertions. The problem is misuse of exceptions: >> >> 1. IF the exception is a part of the contracts <=> the client is supposed >> to handle it, THEN it must be checked. >> >> 2. IF no client can handle it, THEN it shall not be, the program must >> rather abort itself or break into the debugger. > > 2. is what Eiffel programs do, but the compiler does not check > the presence of exception handlers for postconditions that > may fail (and thus raise an exception). If it did, will it not > mean exception handlers pretty much everywhere? No. Exceptions are supposed to propagate. A propagating exception is unhandled one. If you confuse 1 and 2 you get troubles. Another example from Ada is Program_Error, e.g. from Initialize/Finalize/Adjust. It is meaningless and very harmful. If you are in 2, it is too LATE to raise anything. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de