Re: Tasty exceptions



Jon Robertson wrote:

Craig Stuntz [TeamB] wrote:

I really don't agree with this. I think that the only exception
which is not important is one you expect.

Which, by definition, really wouldn't be an exception.

I think that definition of exceptions -- while common -- is so
informal as to be misleading. I *expect* database deadlocks, but they
still violate the contract of the code which runs the queries. IMHO
Meyer's definition is more useful, as it doesn't require knowing what's
in a programmer's head: An exception is a violation of the contract of
a class or method.

--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: http://learningtowhistle.blogspot.com
.



Relevant Pages

  • DbC & TDD: Fizzing Fusion or Flat Fizzle? [2/2]
    ... an invariant is a general clause which ... information: the contract. ... The short form retains headers and assertions of exported features, ... exception handling -- handling abnormal cases. ...
    (comp.object)
  • Re: Help with year to month converson
    ... We havent yet had an occasion where there was an exception to ... to perform these calculations for me. ... I do have the start date, end date and total amount, and if the contract is ...
    (microsoft.public.access.gettingstarted)
  • Re: Question on LSP
    ... UnsupportedOperationException may be thrown if the add op is invoked ... If the user has been dealing with the exception from the outset, ... Which is in contrast to the behaviour user who ignores the contract as ... The only obvious thing here is that defective s/w has to change its ...
    (comp.object)
  • Re: Using exceptions for early exit
    ... Maybe it's an overly painful contract then. ... >> Notice that with your unchecked exception algorithm that as soon as ... > void run; ... When chosing between a language with goto statements versus a language ...
    (comp.lang.java.programmer)
  • Re: What is an interface?
    ... > I still can't see what 'Runnable' gets you if it has no connection to ... Throwing an exception would be the sensible thing to do. ... out at compile time). ... it's just the contract idea. ...
    (comp.lang.java.programmer)