5 ms·
You wrote this, about the potential for user error with a Go example, as a negative: > To Go's credit, it is idiomatically correct (and encouraged) to leverage
by vegancap 5y ago
You wrote this, about the potential for user error with a Go example, as a negative:
> To Go's credit, it is idiomatically correct (and encouraged) to leverage Go's multiple return mechanism to return a second "failure" value if there is a possibility that a function will fail. However, this mechanism can easily be ignored or misused
A few paragraphs above you wrote this in defence of Rust's approach:
> No matter the programming language, people can always write poorly-named functions.
So for Go, user error isn't an acceptable defence, but it is for Haskell and Rust?
I think you made a lot of valid points, but this one seemed contradictory, unless I've missed the point. Apologies if so!
- wyager 5y agoNot OP, but original author. I’m not sure I would agree that poor naming is even the same category of problem as ignoring error return values. Haskell/Rust provide much more robust error-return mechanisms that can’t simply be ignored or forgotten.
- vegancap 5y agoFair point, misunderstanding on my part, suspected it was, thanks for clarifying.