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

> The only difference

That's a significant difference.

It's the only difference if you're only considering blub exceptions, and not a nice exception system in which raising an exception doesn't immediately unwind, so that you can have remote handlers choosing local restart points and such.

> you need to change

Say I can't change it. I want to pass the exception through a third party library I don't control. I don't want to fork it, or can't.

Sum types with pattern matching are definitely nicer than some integer error codes or what have you, but for error handling, they are just a lipstick on error codes.

People outside of the Rust bubble do know what these concepts are, and about languages like OCaml.

Moreover, everyone who ever had anything to do with the concept of the development of exceptions was not an idiot who just didn't see the light of returning a sum type.

> you can handwave that away too

With what plugin for what editor ... :)




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

Search: