Non-structured programming

Last updated

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.

Contents

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.

References

  1. Dijkstra (1968).

Sources

Further reading