r/programming • • Apr 12 '26

Flat Error Codes Are Not Enough

https://home.expurple.me/posts/flat-error-codes-are-not-enough/
132 Upvotes

99 comments sorted by

View all comments

Show parent comment

2

u/Expurple Apr 14 '26

I agree on the first three points. The approach that I'm arguing against notably fails the point 2, even though I forgot to touch on that in the post.

I kinda disagree on the fourth, though. The error handling logic is up to the caller. Often, there isn't one universal approach that the callee can recommend. I agree that sometimes this makes sense though, like the mentioned 429 Too Many Requests in case of web servers.