4 ms·
> I would say that Go's error handling is a billion dollar mistake as well. I think you'll need to substantiate that one with some solid evidence. I don't see
by Cthulhu_ 4y ago
> I would say that Go's error handling is a billion dollar mistake as well.
I think you'll need to substantiate that one with some solid evidence. I don't see anything wrong with Go's error handling that cannot be explained by developer choice.
- za3faran 4y agoI've encountered several dangerous incidents of mistakenly ignored errors at an employer that heavily used golang due to the language's bad design.
- kaba0 4y agoHaving your business code riddled with error handling code is just bad design, and will inevitably result in not properly handling certain cases simply because the developer would prefer to write the actual business logic and can’t always stop doing that. Exceptions (especially checked ones) allow for as fine or crude-grade error handling as needed. Don’t get me wrong, Java’s checked exceptions are not without problems, but compared to Go almost everything is better in this regard.
- lenkite 4y agoThe Manning Book: "100 Go Mistakes and how to avoid them" gives solid examples of common gotchas with Go's error handling. I have seen the below occur again and again in Go. (no compiler help, so this can only be caught in reviews and not if the reviewer is tired). #50: Checking an error type inaccurately #51: Checking an error value inaccurately #54: Not handling defer errors
- frou_dh 4y agoSomething OR Error should naturally be expressed as a sum-type, not a tuple (product-type).