Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Interface with implied Constructor Date: Sun, 21 Jul 2013 16:58:54 -0400 Organization: A noiseless patient Spider Lines: 35 Message-ID: References: <925adeb1-65b5-4a50-86a8-4f04784f8da0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 21 Jul 2013 20:52:49 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="0d73d8cc209bff1c6395088b400d0605"; logging-data="32098"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pq65H9XD0/x60CAXgKXJZ" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: Cancel-Lock: sha1:LHT5kNWDDvuP7bBcYMwKHsPRp1k= Xref: csiph.com comp.lang.java.programmer:24796 On 7/21/2013 3:18 PM, Arved Sandstrom wrote: > On 07/20/2013 04:12 PM, Martin Gregorie wrote: > [ SNIP ] > >> This is a result of my dislike of using Exceptions to signal anything >> except a fatal error and may well be a hangover from writing a lot of C >> in the past. > > You probably know this, in fact I'm sure you do, but in OOP exceptions > are like 95% of the time used for everything but fatal errors. Well, > maybe 98 or 99 percent of the time. (Eighty-seven point three percent of cited statistics are plucked out of thin air. ;-) One problem is that "fatal" is ill-defined. Is an NPE "fatal?" Quite often it is, but sometimes the application is prepared to cope with it -- For example, think of some code throwing NPE while being managed by an IDE's debugger, of think of a servlet throwing NPE without taking down the entire Web container. Somewhere toward the other end of the spectrum, is a NumberFormatException "benign?" Maybe, if the application can protest and prompt for another number. Or maybe not, if the string came from a configuration file and there's nobody to respond to a prompt. The "seriousness" of an exception is not a function of the exception itself, but of the code that catches (or fails to catch) it. -- Eric Sosman esosman@comcast-dot-net.invalid