Jump to content

Non-structured programming

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 96.250.126.152 (talk) at 23:51, 14 March 2018 (Basic concepts: Description of structured versus non-structured was quite wrong. The issue is the control flow, not whether procedures or local variables are used, as described in the "GOTO considered harmful" citation. Corrected and simplified.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Non-structured programming is the historically earliest programming paradigm capable of creating Turing-complete algorithms. It is often contrasted with the structured programming paradigm, in particular with unstructured control flow using goto statements or equivalent. The distinction was particularly stressed by the publication of the influential "Go To Statement Considered Harmful" open letter in 1968 by Dutch computer scientist Edsger W. Dijkstra, who coined the term "structured programming".[1]

Unstructured programming has been heavily criticized for producing hardly-readable ("spaghetti") code.

There are both high- and low-level programming languages that use non-structured programming. Some languages commonly cited as being non-structured include JOSS, FOCAL, TELCOMP, assembly languages, MS-DOS batch files, and early versions of BASIC, Fortran, COBOL, and MUMPS.

Features and typical concepts

Basic concepts

A program in a non-structured language uses unstructured jumps to labels or instruction addresses. The lines are usually numbered or may have labels: this allows the flow of execution to jump to any line in the program. This is in contrast to structured programming which uses structured constructs of selection (if/then/else) and repetition (while and for).

Data types

Non-structured languages allow only basic data types, such as numbers, strings and arrays [citation needed] (numbered sets of variables of the same type). The introduction of arrays into non-structured languages was a notable step forward, making stream data processing possible despite the lack of structured data types[citation needed].

References

  1. ^ Dijkstra 1968, "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."

Further reading

  • Cobb, Gary W. (1978). "A measurement of structure for unstructured programming languages". ACM SIGSOFT Software Engineering Notes. 3 (5): 140–147. doi:10.1145/953579.811114. ISSN 0163-5948.
  • BPStruct - A tool to structure concurrent systems (programs, process models)