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. > > ... that's what those examples are listing. I noticed you conveniently > "forgot" InsufficientFundsException and InvocationTargetException. Feel free > to say that these corner cases don't outweigh the bad side of checked > exceptions (you'll hear no argument from me on that one), but you just > ignored them and then asked me again to list examples, in a rude tone of > voice too. I found it offensive. Please mind your tone and definitely don't > cherry-pick in a counterargument!
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.) >> I'm more likely to have an error calling >> Integer.parseInt than I am close on a file. Amusingly, one of those >> is a runtime exception. :) > > As I already mentioned earlier in the thread. We are in vehement agreement > regarding the consistency of checked vs. unchecked exceptions in java. Right. My question is essentially this: You seem to be claiming that people would like checked exceptions if they had been used well somewhere. I'm asking for an example. I can't say it doesn't exist. You are right that, if someone had a good API that used checked exceptions, it could sway the popular opinion. You are also right that most APIs that have them have some atrocious parts. My claim is that I don't know of a good one. This "mythical well done checked exception API" is a diversion that allows people to cling to the thought that checked exceptions are a good idea. > map/flatMap/Either/Option for OutputStream.close() would be very very > stupid. If you forget to check, which I guarantee the majority will do, you > silently eat I/O errors, which is extremely bad. I think Haskel and a few other languages would like a word with you for calling them stupid. > So I'll just repeat the two arguments that you so conveniently decided to > exclude in your retort. Don't ask me to list more examples again until > you've discussed these two, please, or we'll go in circles all day: >> FundsNotSufficientToCoverTransaction, >> InvocationTargetException 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, 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. -- 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.
