2010/9/22 Cédric Beust ♔ <[email protected]> > > > On Wed, Sep 22, 2010 at 7:58 AM, Kevin Wright <[email protected]>wrote: > >> Checked exceptions *do* force you to handle or re-throw. > > > I consider declaring throws in the signature to be directly equivalent to rethrowing, but I appreciate it's a subjective viewpoint :)
> ... or ignore at the current level by declaring throws in the signature. > > Let me make an analogy that you can probably relate to: I'm sure that one > of the things that you like about case classes is the fact that matches are > exhaustive: if you forget a case, the compiler will tell you right away so > nothing can slip through. > > Checked exceptions are similar: they force you to be exhaustive by asking > you to handle both the success and failure cases, but without requiring you > to do so in the current stack frame (the main value, for me). > > My point exactly! The ability to do an exhaustive check like this needn't be limited to only exception handling, such a limitation can only encourage abuse of the mechanism (as we've seen). Instead, a language can offer exhaustive pattern matches in a range of other, non-exceptional scenarios, so offering the best of both worlds. -- > 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.
