Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"checked exceptions actually help you out quite a bit, because you don't have a problem with stray exceptions taking down entire subsystems"

Dunno about this. It's some time since I did any Java, but it seems to me that if you want to isolate a sub-system then the thing to do is to isolate it in the code explicitly where you want the sub-system isolated (i.e. like C++'s `catch (...)`) rather than force exception propagation/chaining through every function in the call chain.

I've found far more nasty problems caused by exception masking than I have by too many exceptions being thrown. I'm not sure what sort of system you might be working on where erroneous data is less of a problem than an exception.



You're correct, the right way to handle exceptions is to catch them in the right place so the right "unit of work" fails -- that's exactly what the article author describes. However, he argues that many programmers are too lazy or stupid to do that in the presence of checked exceptions.

"I'm not sure what sort of system you might be working on...."

I'm not sure what kind of system we're talking about either. Accepting the article's assumption of such stupid and/or lazy programmers, and accepting the implicit assumption that it's possible to produce useful software with such programmers, I'm guessing it's some kind of web-based business software.


"Accepting the article's assumption of such stupid and/or lazy programmers, and accepting the implicit assumption that it's possible to produce useful software with such programmers, I'm guessing it's some kind of web-based business software."

LOL

Actually the software I work on is web based business software. I sincerely hope that I don't cause the sort of problem alluded to in TFA.

The fact that checked exceptions make it harder to do the right thing I guess is exactly the point. An exception is a method for forcing an abnormal program flow, and the checked exceptions reduce this to an error return mechanism. You end up with the worst parts of exceptions and error returns -- way to go!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: