To Documents

Writing Algorithms with Control Structures

Background

Since the invention by Von Neumann of the stored program computer, the ability of computing equipment to alter its behavior, depending on input datai was gradually recognized. Calculating machines had, for some time, been able to perform fixed arithmetic operations on data, but the potential of machines capable of making decisions opened up many new possibililities. Machines that could make decisions were capable of sorting records, tabulating and summarizing data, searching for information, and many more advanced operations that could not even be imagined at the time.

In early programming languages, like Fortran (first invented in 1954), the goto statement allowed the computer to deviate from the sequential execution of the program instructions. The goto statement was recognized to be a very powerful construction, and soon, programs of increasing complexity and power were developed.

However, the increasinging complex code became harder and harder to maintain. Edgar Dijkstra, in 1966, was one of the first persons to recognize that this run away complexity of programs was due to the overuse of the goto statement (Dijkstra, E. W., "Go To Considered Harmful," Communications of the ACM, March 1966). In fact, it was determined shortly thereafter, that the goto statement is not needed at all. This was the birth of the discipline of Structured Programming.

Dijkstra proved that any program that can be written with goto statements could be rewritten using only these constructions:

 

Algorithms

 

Sequence

 

Repetition

 

Decision