1.3.1 Using Structure

Well-designed, clear programs are based on the explicit underlying methodology called structured programming. As problems and their solutions become more sophisticated, the brute-force or ad hoc method of programming becomes much less effective. Compilers, operating systems, business management systems, and word processing systems consist of many thousands of program statements. Just as writing a lengthy book is several magnitudes more difficult than writing a paragraph, so is the process of developing a large programming system much more involved than writing a short program. There must be an overall structure.

An example of a large and complex program is an operating system. Many years ago it was thought that operating systems could not be implemented without errors. The immensity of the task was believed to cause inherent problems that could not be isolated and debugged in advance of system implementation. Hence system failure seemed inevitable and getting the system up and running meant a long trial-and-error period of testing and debugging. A new methodology of system design based on the concept of structured programming has demonstrated, however, that error-free operating systems are possible.

Since the programs you see as a student may be relatively trivial, the need for a well-founded methodology of programming may not be evident. However, imagine a large program (twenty pages long, and over a thousand lines of program statements) that you did not write. If you were assigned the task of modifying the program to add a new feature, how or where would you start? Certainly you must have a full understanding of what the program does, how it does it, and how it relates to other programs that use it or are used by it. Anyone who intends to read, write, modify, or correct any programming systems with more than a few dozen statements should use structured programming.