Hacker News new | ask | show | jobs
by dgellow 2366 days ago
> Also, since programmers in general think less about errors

That's one reason I like Go's approach, even if the boilerplate is ugly. When writing Go code, I'm pushed to think about the `err` returned value. When reading Go code, I know directly how `err` is handled, without any surprise, and if it isn't then that should be for a reason, so something to dig out. While it's quite annoying at first, after some time it becomes quite easy to either mentally filter out the error handling boilerplate (thus focus on the actual logic), or focus on it.

Of course, YMMV.

1 comments

There's some boilerplate (a bit less compared to Go) required to deal with errors in Rust too, but additionally, the compiler can enforce you can't get at the return value without dealing with the error variant. I just checked that there are also static checkers for Go that'll tell you if you forgot to check an error.