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

Don't care for the way they do exceptional handling. Make errors part of the type system



Can you ELI 5?


Handle errors using exceptions (like most languages today, e.g. C++, Java, Python) vs errors as values (e.g. Rust, Go, Haskell).

The type system (especially for Rust and Haskell) forces you to always handle the error, or you have a compilation error. With some syntactic sugar (? in Rust, do notation in Haskell), you can be as concise as exception-based languages.


OK a lot of pieces just dropped in the place with your explanation. I’ve never heard it said so compactly before.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: