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

Honestly every language needs Option and Result types (and exhaustive pattern matching to deal with them). They were invented 50 years ago and languages still come out without them.


The thing that is unfortunate is that Result kind of encourages early failure and bubbling up vs actually handling the error and recovering or crashing.

The other thing you don't see much in Result heavy code is coalescing multiple errors (like for example, most parsers in Rust just bail out at the first error when you want all the errors at once). It's possible to write code that does that, and exceptions have the same problem, but it's still a bit cumbersome.

The real frontier of error handling is algebraic effects, or resumable exceptions.




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

Search: