2 ms·
You're right that I've never written C. I know enough bash to hate using it. I'm familiar with Maybe/pattern matching in Haskell, and I've used OCaml too. I've
by artursapek 12y ago
You're right that I've never written C. I know enough bash to hate using it. I'm familiar with Maybe/pattern matching in Haskell, and I've used OCaml too. I've seen more than one approach.
I also think you're correct about everything you said, especially about the inconsistent treatment of errors in Golang's stdlib, and the difficulty of differentiating between them. I've noticed the same and it has annoyed me. When writing my own application code I do maintain a consistent pattern for returning my own errors, but I have been frustrated when consuming the stdlib for this very reason.
Maybe as my code base grows I'll come to agree with you, but for now at least it seems to be at a nice middle ground where the error handling isn't overwhelming and it isn't swept under the rug. And to my knowledge, none of the bugs I've created when writing Go code have come from my understanding of the program flow being interrupted by error handling code. And I've probably avoided many bugs because of this pessimistic approach I take when coding, as jalfresi put it in his comment[1].
[1] https://news.ycombinator.com/item?id=8878852 https://news.ycombinator.com/item?id=8878852