Re:Global variables are bad (2013)
by notacoward on Thursday July 26, 2018 @08:32AM
(#17616893)
I wouldn't say gotos are fine, but they're sometimes better than alternatives. I'll take a "goto" to an error-cleanup cascade at the end of a function over ten nested three-line functions, a mini state machine, or lots of little state variables (the most common alternatives) any day. If the language has destructors or deferreds or anything else that automatically triggers when leaving scope that's probably even better, but some older languages - notably C - don't, so dogma often leads to worse alternatives.
[ Parent
| on HN ]
There are no comments on this comment yet.