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)

    In Vietnam, some of us lost control of our lives. I want my life back. I almost feel like I’ve been missing in action for twenty-two years.
    Wanda Sparks, U.S. nurse. As quoted in the New York Times Magazine, p. 72 (November 7, 1993)

    By the flow of the inland river,
    Whence the fleets of iron have fled,
    Where the blades of the grave-grass quiver,
    Asleep are the ranks of the dead:—
    Francis Miles Finch (1827–1907)