News for hackers. Stuff that matters.
Re:Studying the relationship between exception handling and ... by throw_m239339 on Saturday September 18, 2021 @12:27AM (#28573714)
Why do people praise Go when it comes to error handling? It's the worst of both worlds since its std libs returns errors sure, but anything can panic as well, which is basically a poor's man exception system.

Rust on the other hand, like many other things got it mostly right. If you're going to use errors as a values then you need some constructs to deal with that at the language level.

Go's solution isn't more sophisticated than C error codes.

Re:Studying the relationship between exception handling and ... by mindwok on Saturday September 18, 2021 @01:30AM (#28573905)
That's not exactly true. There's very few cases where the standard library will panic, and the handful of cases where it does is for programming errors (like passing a non-nil, zero length buffer into io.CopyBuffer).
Re:Studying the relationship between exception handling and ... by comex on Saturday September 18, 2021 @01:11AM (#28573846)
Rust also has panics as a separate feature from errors-as-values, same as Go…