Structured Programming with go to Statements

Structured Programming with go to Statements by Donald E. Knuth.


A consideration of several different examples sheds new light on the problem of creating reliable, well-structured programs that behave efficiently. This study focuses largely on two issues: (a) improved syntax for iterations and error exits, making it possible to write a larger class of programs clearly and efficiently without go to statements; (b) a methodology of program design, beginning with readable and correct, but possibly inefficient programs that are systematically transformed if necessary into efficient and correct, but possibly less readable code. The discussion brings out opposing points of view about whether or not go to statements should be abolished; some merit is found on both sides of this question. Fina!ly, an attempt is made to define the true nature of structured programming, and to recommend fruitful directions for further study.

As I learned today in Christophe Lalanne‚Äôs A bag of tweets / May 2014, this is the origin of the oft-quoted Knuth caution about “premature optimization.”

It’s one thing to know that Knuth once said something about “premature optimization” but quite another to see it in a larger context.

Be forewarned, the article has a table of contents and runs forty (40) pages.

However, it is delightful Knuth style writing from 1974.

If nothing else, you may be less dogmatic about the future of programming after reading Knuth’s projections from forty years ago.


Comments are closed.