goto
goto is a programming statement that transfers execution
to another point in a program.
instead of following the normal sequential flow of code,
the program "jumps" directly to a labeled location.
example (c):
start:
printf("hello\n");
goto start;
in early programming languages such as assembly, basic,
and early c, goto was widely used to control program flow.
however, excessive use of goto often produced code that
was difficult to read and maintain. this style became
known as "spaghetti code".
in 1968 computer scientist edsger w. dijkstra wrote the
famous note "goto statement considered harmful". the essay
argued that unrestricted jumps make programs harder to
reason about.
this criticism helped popularize the principles of
structured programming, which rely on clear control flow
using constructs such as:
- if
- while
- for
- functions
today goto still exists in some programming languages,
but its use is rare and usually limited to specific
low-level situations such as error handling in c.
in marcoderspace the phrase "go-to /welcome" is used
intentionally as a small reference to this classic
piece of programming history.