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,7728b533f7ab5fb6 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!fdn.fr!freenix!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Avoiding side effects Date: Tue, 30 Sep 2008 13:36:20 +0200 Organization: Adalog Message-ID: References: NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1222770681 22354 195.25.228.57 (30 Sep 2008 10:31:21 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 30 Sep 2008 10:31:21 +0000 (UTC) User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:2161 Date: 2008-09-30T13:36:20+02:00 List-Id: Anders Wirzenius a �crit : > Please don't feel like I am provocative. I just want to find out > the difference between exceptions and side effects: > > Why is an exception in this case not considered to be a side > effect? > To me, an exception is more like a kind of result rather than a side-effect. A subprogram is intended to provide a certain service; either it can provide the intended result, or it must tell the caller, in an unambiguous way, that the correct result could not be provided; that's what exceptions are for. If you compare exception with a return code, the difference is that you can easily ignore a return code, but not an exception. And remember: "There is only one thing worse than a program that crashes: a program that gives wrong, but likely results." -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr