Control Flow - Minimal Structured Control Flow

Minimal Structured Control Flow

See also: Structured program theorem

In May 1966, Böhm and Jacopini published an article in Communications of the ACM which showed that any program with gotos could be transformed into a goto-free form involving only choice (IF THEN ELSE) and loops (WHILE condition DO xxx), possibly with duplicated code and/or the addition of Boolean variables (true/false flags). Later authors have shown that choice can be replaced by loops (and yet more Boolean variables).

The fact that such minimalism is possible does not necessarily mean that it is desirable; after all, computers theoretically only need one machine instruction (subtract one number from another and branch if the result is negative), but practical computers have dozens or even hundreds of machine instructions.

What Böhm and Jacopini's article showed was that all programs could be goto-free. Other research showed that control structures with one entry and one exit were much easier to understand than any other form, primarily because they could be used anywhere as a statement without disrupting the control flow. In other words, they were composable. (Later developments, such as non-strict programming languages - and more recently, composable software transactions - have continued this line of thought, making components of programs even more freely composable.)

Read more about this topic:  Control Flow

Famous quotes containing the words minimal, structured, control and/or flow:

    For those parents from lower-class and minority communities ... [who] have had minimal experience in negotiating dominant, external institutions or have had negative and hostile contact with social service agencies, their initial approaches to the school are often overwhelming and difficult. Not only does the school feel like an alien environment with incomprehensible norms and structures, but the families often do not feel entitled to make demands or force disagreements.
    Sara Lawrence Lightfoot (20th century)

    The subject of the novel is reality liberated from soul. The reader in complete independence presented with a structured process: let him evaluate it, not the author. The façade of the novel cannot be other than stone or steel, flashing electrically or dark, but silent.
    Alfred Döblin (1878–1957)

    Imagine believing in the control of inflation by curbing the money supply! That is like deciding to stop your dog fouling the sidewalk by plugging up its rear end. It is highly unlikely to succeed, but if it does it kills the hound.
    —Michael D. Stephens. “On Sinai, There’s No Economics,” New York Times (Nov. 13, 1981)

    Our sense of these things changes and they change,
    Not as in metaphor, but in our sense
    Of them. So sense exceeds all metaphor.
    It exceeds the heavy changes of the light.
    It is like a flow of meanings with no speech
    And of as many meanings as of men.
    Wallace Stevens (1879–1955)