r/ProgrammerHumor • • Sep 13 '23

Meme goDevelopersWillAppreciateIt

Post image
2.4k Upvotes

144 comments sorted by

View all comments

Show parent comment

1

u/aMAYESingNATHAN Sep 13 '23

Okay maybe in the purest definition it is, but you made it sound like you're manually reimplementing the actual stack unwinding. I.e. clearing up the stack frame when you return from a function. Which makes it sound like a lot more work than if (err) return;

I'm not saying don't use exceptions, because you absolutely should, for exceptional cases. I'm just saying you shouldn't use them entirely in replacement of regular error handling. An uncaught error in a http server to return 500 is exactly the kind of use case that makes sense.

Propagation of errors is nice, but I'd argue if your code is structured in a way that a non-exceptional error has to be propagated far up the call stack then your code is structured badly.