That's a big ongoing discussion.

You can read an old blog post from Brian Goetz which is mostly a fan (at
least in 2007) of checked exception but pointing out that is was causing
some ugly code. It has highly improved in JDK 7 and 8.

http://briangoetz.blogspot.ca/2007/06/remove-checked-exceptions.html

Then you have Josh Bloch, who's talking about it in Effective Java
Use checked exceptions for recoverable conditions and runtime exceptions
for programming errors

So, he's ok with them, but in a limited scope. I tend to agree with him. I
remember those terrible times when Hibernate was throwing checked
HibernateExceptions. That was a really bad decision because when there's an
exception in Hibernate, the only thing you want to do is to rollback the
transaction. Which normally occurs at a really high level.

It's the same with IOExceptions. In general, there's not much you can do
about them.

Finally, a really nice article from Brian commenting Josh, Rod Johnson and
Bruce Eckel. They have a decent reputation ;-)
http://www.ibm.com/developerworks/library/j-jtp05254/

On 12 August 2016 at 18:00, Kevin Burton <burtona...@gmail.com> wrote:

> Both the Elasticsearch and Cassandra drivers now use unchecked exceptions.
>
> Personally I consider this harmful.
>
> It's entirely possible I'm wrong here, but I can't find any sort of
> definitive/referential explanation why some consider checked exceptions to
> be harmful / evil.
>
> I've found a few documents but most of these are from junior (IMO)
> programmers complaining that they don't know what to do with.  Either that
> or they just call System.exit() ...
>
> Is there anything authoritative by someone with a decent reputation? Maybe
> a JVM author or language author clearly making the case of why checked
> exceptions are bad.
>
> Additionally, it would be nice to see what the checked exception
> workaround could be.
>
> I was thinking of lambda function like withCheckedException() so that I
> can make unchecked exceptions become checked ones.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mechanical-sympathy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mechanical-sympathy+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mechanical-sympathy+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to