On Aug 18, 4:48 pm, Peter Becker <peter.becker...@gmail.com> wrote:
> phil swenson wrote:
> So you are saying it is better to quietly change behaviour than to make
> a change to an API that breaks source compatibility? I certainly would
> not agree to that.

So every API written in every other language ever written in the
history of software got it wrong eh?
Exceptions mean something went wrong.  You will detect this when it
happens (testing, iterative dev).  And again, it's almost always
because of a bug or something else you can't gracefully handle (like
server down as you mention).  If you decide to handle one of these
conditions, that's fine - but usually it's better to let the condition
bubble up to the top thread an notify the user/email the admin.


> Sorry, but I call BS on that. SQLExceptions get thrown when the DB
> server is down or in trouble, when the network has issues and possibly
> other reasons that you do not encounter in test environments, so your
> testing won't help.

Ok, I modify my original claim of "it's almost always a bug" to "it's
almost always a bug or a condition that you can't do anything about in
code".  If your db server is down, all you can do it manually
intervene and get the thing running again.  If you are in a scenario
where data loss is unacceptable (where you would do a catch/retry),
then you still need to handle runtime exceptions anyway.

The key is to make the exception known and notify someone.  Checked
exceptions usually have the opposite effect.  You can say "that's
because people don't use them correctly."  Sure, but I still haven't
seen anyone who does use them correctly.  It's too much of a PITA.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to