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,ec21c3c7cdc7ff3e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Handling invalid objects Date: Sun, 19 Mar 2006 11:00:04 +0000 Organization: Pushface Message-ID: References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> <41LSf.4126$TK2.1805@trnddc07> <7LOSf.34253$oL.29742@attbi_s71> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1142765999 14116 62.49.19.209 (19 Mar 2006 10:59:59 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 19 Mar 2006 10:59:59 +0000 (UTC) Cancel-Lock: sha1:LBSO40bd3K3PNKQMxshfc1AkCGU= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:3447 Date: 2006-03-19T11:00:04+00:00 List-Id: Justin Gombos writes: > Exception raising and handling is often viewed as writing code that > will never execute. Predefined exceptions must be handled when > there is an expectation they will be raised, but their usefullness > stops there. Beyond that, it's like writing erroneous code on > purpose. Code that _should_ never execute, perhaps! Exceptions are for things that can't be handled locally because of lack of application knowledge. For example, how to handle a Socket_Error? And also, I think, for contract violation, where the contract can;t be enforced in the language. Now we can say 'not null access' but in Ada95 we can't. >> There are cases where exceptions are outlawed; most of them are not >> justified. Even if they were all justified, advocating a return to >> the mess that error codes create is not a viable option. > > It's a mess regardless. Clearly Ada is deficient in this respect, > as all languages seem to be. I think it's called living in the real world.