logoalt Hacker News

groestl • today at 6:35 PM • 2 replies • view on HN

The question is _where_ the error needs to be handled. It's almost never directly at the call site. And then there's a few issues with checked exceptions and Java language things (RMI, closures, etc) which make checked exceptions cumbersome. An exception (checked or not) might be worse than sum types, but they're still a thousand times better then returning an error in-band.


Replies

drdec • today at 7:57 PM

> The question is _where_ the error needs to be handled. It's almost never directly at the call site.

Which is why exceptions in Java can bubble up the stack? You don't have to catch it in a particular method you can let it go to the caller of the method, and so on.

spullara • today at 7:56 PM

Rust and Go literally have you handle it at the call site by default and if you don't want to you have to pass it on.