“Goto statement considred harmful”
Strange how this often gets brought up but nobody mentions Frank Rubin's criticism 'GOTO Considered Harmful Considered Harmful'.
Goto is one of those "it depends" things:
Case 1 (in 'C'). Within a function you see:
do_stuff();
Ah, a simple function call you think. Wrong - do_stuff() is a function-like macro which included a condition goto to a label else where in the function. Unstructured code with hidden semantics.
Case 2. A block of code monitoring a safety critical system:
if ( isThereAProblem() )
something_bad_has_happened = true;
/* More code related to normal operation */
/* Handle any errors */
It would be much better in this case to use a 'goto' to jump immediately to a critical error handler rather than having to propagate the error condition through a potentially complex control flow graph.