Goto is Not Evil, Okay?

  • Goto is a low level construct that shouldn't be used if your language has an appropriate high level construct you could use instead.

    For example, try...finally constructs allow you to do your clean up once in a single place, and some languages allow you to break out of more than one loop at once.

    If your language / operating environment doesn't have these constructs, then yes, fall back on goto.

    (When I were a lad, we didn't 'ave IF-THEN-ELSE, all we 'ad were IF-THEN and GOTO. And line numbers. And we loved it. I wouldn't want to go back to that though.)