4 ms·
> Although developers skipping return value checks is true in most languages. Yes, which is why I disagree with Go's approach for error codes as return values.
by unscaled 11y ago
> Although developers skipping return value checks is true in most languages.
Yes, which is why I disagree with Go's approach for error codes as return values. I'm not saying that exceptions are the right solution everywhere, but if you return a error code, you should make it pretty hard to ignore it. In languages with Algebraic Data Types it's very easy to use Maybe or a Error(code) | Success(result) type. You've then got to explicitly deconstruct that type to get the result, so it's a bit harder to just forget handling the error.