Hacker News new | past | comments | ask | show | jobs | submit login

Checked exceptions are the compiler forcing the developer to consider error cases.

What's not to like about that?

Contrast with all the other approaches (runtime exceptions, return codes, Either/Result, etc...) where the developer can happily ignore errors, the code will compile, and then crash at runtime.




I'd be happier with checked exceptions if Java assumed that

  list.stream().map(doStuff)
might throw whatever doStuff might throw, but instead map is defined so that doStuff can never throw any checked exception, which requires smuggling out every real-world failure mode.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: