News for hackers. Stuff that matters.
Re:Rust error handling by hikarikuen on Saturday September 14, 2024 @09:39PM (#41544527)
This recent post resonated with me: https://cedardb.com/blog/exceptions_vs_errors/

There are certain obvious (and some less obvious) benefits to both exceptions and results, but I get the impression a lot of programmers have overreacted against exceptions.

Exceptions "just work" the same in every codebase and require little boilerplate in most languages. I think results really shine for internal business logic where errors are more "invalid" than "exceptional."

Re:Rust error handling by surajrmal on Sunday September 15, 2024 @01:17PM (#41548785)
That's what panics are for. They compile to the same code c++ exceptions would. You can unwrap your results to turn them into exceptions.