Declaring an exception in your throws clause is very much "doing something".
Checked exceptions lead to messier clean code because you *must* either catch/wrap/rethrow them, or pollute your signature. They lead to less robust code because you're not forced into acknowledging an exception where it's irrelevant, often resulting in code that suppresses them instead of letting them bubble up the stack. And, I implore you: Please stop blurring the distinction between checked and unchecked exceptions, the difference is absolutely critical in this discussion! 2010/9/22 Cédric Beust ♔ <[email protected]> > > > On Wed, Sep 22, 2010 at 8:11 AM, Kevin Wright <[email protected]>wrote: > >> >> Which is why unchecked exceptions are good. Checked exceptions force you >> to do something with them NOW >> > > Incorrect. You just declare them in your throws clause and you write your > code assuming that no exceptions are thrown, which leads to code that is 1) > cleaner (unpolluted by error checks) and 2) more robust (since the compiler > will make sure you handle the error case *somewhere* as opposed to just > ignoring it). > > -- > Cédric > > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<javaposse%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > -- Kevin Wright mail / gtalk / msn : [email protected] pulse / skype: kev.lee.wright twitter: @thecoda -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
