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

My main gripe with checked exceptions is they create a whole other possible code path on each `catch` clause. I tend to keep checked exceptions to the absolute minimum where they actually make sense, all the rest are RuntimeExceptions that should bubble up the stack.


That's kind of how you do it in go. Either:

1. Bubble up error (as is/wrapped/different error. 2. Handle error & have a (possibly complex) new code path.

There's also the panic/recover that sometimes is misused to emulate exceptions.


But so would every single other method to react to different types of errors, no?

In something like go, you're even required to create the separate code path for EVERY SINGLE erroring line, even if your intention is simply to bubble it up.


They don’t create any other code paths than RuntimeExceptions.




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: