Tuesday, October 19, 2010

Checked Exceptions

I definitely hate them. They are evil.



He is a boy-scout in comparison.

2 comments:

Valerio said...

ROTFL :D Skeletor!!
oh.... what memories..

I agree with you!! Definitely!

By the way, did you remember to check a bunch of exceptions just to open a f**##!@*g text file to read?

Oh, yes, sorry.. I'm forgetting that this is the safetiness of Java :P

Unknown said...

Yeah... childhood memories.

I think that nowadays most people agree that checked exceptions are not an extremely good idea.

I'm definitely against, because the options are:
1. wrap them in your own exception... sometimes this makes sense, sometimes not
2. add them to the signature... and have higher level code depending from implementation details (the fact that you are actually opening a file instead of generating the data from magic)

In fact the only reasonable option is the 1), but it's a whole lot of extra effort.