Not All Goto Statements Patch Up Wooly Thinking!All too often, goto statements are used to patch up wooly thinking or an ill-defined algorithm. However, there are situations where the use of the goto statement is justified. For example, if there is an emergency situation in a process-control application, is it really better to set a flag and check it later in the algorithm than to take a direct route via a goto? The "goto statement should not be used" rule is now advisory rather than required, and an additional two rules narrow down the circumstances under which it is acceptable: The goto statement shall jump to a label declared later in the same function. Any label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statement.
The goto statement shall jump to a label declared later in the same function.
If you detect a real emergency...
GOTO "never left the building" for assembly language programmers.
I saw that sign recently on one of those "funny photos" sites, under the heading "Meanwhile in Aus" or some such.
I now think of it as one of those tools that one should be aware of, but should only use when the situation absolutely warrants it