Goto
GoTo (goto, GOTO, GO TO or other case combinations, depending on the programming language) is a statement found in many computer programming languages. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control. The jumped-to locations are usually identified using labels, though some languages use line numbers. At the machine code level, a codice_1 is a form of branch or jump statement, in some cases combined with a stack adjustment. Many languages support the codice_1 statement, and many do not (see § language support).

The structured program theorem proved that the codice_1 statement is not necessary to write programs that can be expressed as flow charts; some combination of the three programming constructs of sequence, selection/choice, and repetition/iteration are sufficient for any computation that can be performed by a Turing machine, with the caveat that code duplication and additional variables may need to be introduced.

In the past there was considerable debate in academia and industry on the merits of the use of codice_1 statements. Use of goto was formerly common, but since the advent of structured programming in the 1960s and 1970s its use has declined significantly. The primary criticism is that code that uses goto statements is harder to understand than alternative constructions. Goto remains in use in certain common usage patterns, but alternatives are generally used if available. Debates over its (more limited) uses continue in academia and software industry circles.
Q613299
statement
Concept
Q9143
programming language
Concept
Q190686
function call
Concept
Q817849
labels
Concept
Q6553274
line number
UNK
Q55813
machine code
Concept
Q813911
branch or jump statement
Concept
None
§ language support
UNK
Q2635326
structured program theorem
MEDIA
Q185092
flow chart
Concept
Q163310
Turing machine
Concept
Q1105830
code duplication
Concept
None
criticism
UNK
None
common usage patterns
UNK
None
alternatives
UNK
Q750997
Goto
Concept
1960-01-01T00:00:00Z^^http://www.w3.org/2001/XMLSchema#dateTime
1960
DATE
1970-01-01T00:00:00Z^^http://www.w3.org/2001/XMLSchema#dateTime
1970
DATE
+1^^http://www.w3.org/2001/XMLSchema#decimal
1
NUMBER
+1^^http://www.w3.org/2001/XMLSchema#decimal
1
NUMBER
+1^^http://www.w3.org/2001/XMLSchema#decimal
1
NUMBER
+1^^http://www.w3.org/2001/XMLSchema#decimal
1
NUMBER
instance of
different from
used by