I spied a goto. Ctrl/Command+F spies 60 gotos. CS students: point to the Linux source code if your professor ever gives you grief about gotos.
1. You're using the goto for error handling and cleanup in a function; and
2. You only jump in a forward direction.
ON ERROR GOTO handler
[try code here]
GOTO finally
handler:
[catch code here]
finally:
[finally code here]Seeing even one goto jumping backward would be much more surprising, and seeing what made gotos get their bad rep, overlapping goto regions, would be completely shocking in any quality code base.
- if-statements
- switch-statements
- break
- continue
- exception handling
The whole "gotos are bad" really needs to die.