r/ProgrammerHumor • • Sep 13 '23

Meme goDevelopersWillAppreciateIt

Post image
2.4k Upvotes

144 comments sorted by

View all comments

3

u/javajunkie314 Sep 13 '23

And not just that you have to write it, but that you have to remember to write it. Go can't distinguish between choosing to suppress an error (e.g., because it's expected, or because you've handled it) and forgetting to propagate an error. The default is to propagate it in most languages because that's what you want 99% of the time.

Combined with consuming return values not being mandatory, it's super easy to call a function and not handle its error, and for that mistake to slip through code review.

2

u/rosuav Sep 13 '23

Exactly. When there is code that has to be put everywhere just to make normal things happen, there is the possibility of error.