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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,f66d11aeda114c52 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Building blocks (Was: Design By Contract) Date: 1997/09/21 Message-ID: #1/1 X-Deja-AN: 274289488 References: <5v34m5$pl9$1@trumpet.uni-mannheim.de> <34215E3D.77AE@gsfc.nasa.gov> <3421A76F.4709@pseserv3.fw.hac.com> Organization: Estormza Software Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-21T00:00:00+00:00 List-Id: In article <3421A76F.4709@pseserv3.fw.hac.com>, "W. Wesley Groleau x4923" wrote: >Or, perhaps I know that the guy that wrote routine X sometimes >raises exception Y AFTER X has already done the work I want. >Why shouldn't I ignore exception Y in that case? This is a misuse of the exception mechanism. Either the subprogram does the work, satisfying the postcondition, or raises an exception, because it cannot satisfy its postcondition. Don't use exceptions as a way of passing back status in the normal case, use them strictly to indicate failure to satisfy postconditions. (And also to indicate failure by the client to satisfy preconditions.) -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271