On Friday, March 25, 2011 2:29:32 PM UTC+1, Josh Berry wrote:

> On Fri, Mar 25, 2011 at 8:42 AM, Reinier Zwitserloot <[email protected]> 
> wrote:
> > On Friday, March 25, 2011 12:33:41 PM UTC+1, Josh Berry wrote:
> >>
> >> I asked for an example where you prefer checked because the exception
> >> lets you know you can do something about it.
> >
>
> You are a master at screwing with quote trees...  I hadn't forgotten
> what you hadn't mentioned yet.  (I was referring there to where I
> asked for void methods where you don't typically just rethrow or
> log/ignore the exception.)
>
>
>
How did I 'screw with quote trees'? All my quotations have been in order and 
from a single post. You did not elaborate on either 
InvocationTargetExceptions or InsufficientFundsException anywhere in your 
response, but you did ask me again to list examples. What did I miss?

> I didn't exclude them in my retort, I've still got the context where I
> began asking for APIs and eventually loosened it to just an exception.
>  Without the API around these two exceptions,
>

InvocationTargetException is an exception in the standard runtime libraries. 
Invoking methods and constructors via reflection can cause this to be 
thrown. It indicates that the invocation worked just fine, but the thing you 
invoked threw an exception. While technically Method.invoke() does return 
something (Object, to be precise), if the author of the invoke call (thinks 
he) knows that the method doesn't return anything anyway, why would he check 
it? In many circumstances it walks, quaks, and looks like a 
duch^H^H^H^Hvoid-returning method. It's an example that essentially fits 
your requirement of an example a checked exception thrown by a 
void-returning method that seems like decent API.
 

> it is impossible for me
> to say that they should always be checked.  In fact, just looking at
> the name of the first, I can already say I prefer the monadic style
> I've seen covered here to exceptions:
>
> http://debasishg.blogspot.com/2010/09/domain-models-thinking-differently-in.html
>  You seem hellbent against that style, though.
>
Is this a no true scotsman argument, or did we just move on to: Okay, there 
_ARE_ examples of decent usage of Checked Exceptions, but I just feel there 
aren't enough of them to warrant all the pain. Which is a fine position to 
take, just be aware that there's an inherent "personal taste" aspect to such 
a claim. 

-- 
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.

Reply via email to