This article needs additional citations for verification .(April 2025) |
Non-structured programming (a.k.a. unstructured programming) is the programming paradigm that describes the state-of-the-art of programming before the structured programming paradigm was envisioned and involves the use of the goto
statement for control flow.
A non-structured codebase uses goto
to jump to a source code label or line number. This is in contrast to structured programming which uses control flow consisting of sequencing, selection (if/then/else) and iteration (while and for) instead of goto
.
The use of goto
, unstructured programming, is criticized for producing unreadable, spaghetti code in the 1968 open letter Go To Statement Considered Harmful by Dutch computer scientist Edsger W. Dijkstra, [1] who coined the term structured programming.[ citation needed ]
Any programming language that provides goto
can be used to write unstructured code. Notable languages that rely primarily if not exclusively on goto
for control flow include JOSS, FOCAL, TELCOMP, any assembly language, batch file, and early versions of BASIC, Fortran, COBOL, and MUMPS.
The unbridled use of the go to statement has as an immediate consequence that it becomes terribly hard to find a meaningful set of coordinates in which to describe the process progress. ... The go to statement as it stands is just too primitive, it is too much an invitation to make a mess of one's program.