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

Checked exceptions failed because developers are lazy and don't want to check for errors.

Checked exceptions force you to do more work, but it's essential work to make your code more robust.

Replacing them with runtime exceptions gives you the illusion of clearer code, but all you have is actually code that is more likely to crash.



It's not a matter of laziness. Most of the time there's just nothing you can do.

Like if you try to construct a URI based on a configured URI string, and get URISyntaxException... wtf should you even do? You can't recover, because your code shouldn't be mutating config. Similarly with basically any JSON parsing exception. And most disk read/write exceptions.

And in modern applications the caller is probably on the other side of an RPC call, and checked exceptions won't propagate sanely across the RPC anyway.




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: