The GOTO Statement
Created | Updated Jan 27, 2006
GOTO is a statement in some computer languages with which the order of execution of a program can be controlled. In short, GOTO tells the program to continue its execution not at the next statement as usual but at another statement.
The use of GOTO as a statement in programming languages such as BASIC, COBOL and others, has become a religious issue. Newbie programmers in the aforementioned languages are likely to use GOTO statements in large quantities, resulting in 'spaghetti' code that nobody, even the author, could ever follow or maintain. Computer scientists in general detest the use of GOTO; see Edsger W Dijkstra's 1968 note 'GOTO Statement Considered Harmful' (this note, among other publications, started the 'structured programming' holy wars).
It must be stated, however, that the GOTO statement is at times very useful to get around the lack of a better structure in the language, for certain types of loops for instance, and could also be essential for error trapping.
Amusingly, program code completely without GOTOs, sufficient size and complexity provided, is equally hard to maintain, regardless which programming language is used.