error-via-return-value is far inferior to anything else as a complete 
solution to what checked/unchecked exceptions are trying to do. Here are the 
problems with it:

(A) For any method that would ordinarily return void, this boils down to 
C-style "return error codes". I pray I don't have to explain why this is far 
far worse compared to exceptions (of either checked or unchecked variety).

(B) Where you can get away with returning maybes/options, you're making it 
much harder for code to decide to defer the handling of this error condition 
to something up the chain. It's also infectious - if as part of doing your 
thing you could run into errors, then you have to turn whatever you return 
into an Option/Maybe guard as well. At some point virtually every method 
returns option/maybe.

(C) You don't solve the problem of "where do we draw the line?" - when does 
an exception become sufficiently unlikely that you're better off making it a 
checked exception? The same question applies to: When do we return Option 
and when do we not? You're not solving any problems here.

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