Structured Programming  «Prev  Next»
Lesson 1

Introduction to Structured Programming

This module examines the fundamental concepts of structured programming. After completing the module you will have the skills and knowledge necessary to:
  1. Describe structured programming
  2. Identify disadvantages of unstructured programs
  3. Describe and use pseudocode
  4. Describe the three control flow constructs of structured programming
  5. Identify advantages of using subprograms
To begin this module, we will define what structured programming is.

Structured programming is a programming methodology aimed at improving the quality and development time of a computer program by making extensive use of functions, block structures and repetitive loops.
This is in contrast to using simple tests and jumps such as the goto statement which could lead to spaghetti code which is difficult both to follow and to maintain.
It emerged in the 1960s particularly from a famous letter with regards to the "Go To" Statement Considered Harmful, from Edsger Dijkstra in 1968. This was supported theoretically by the structured program theorem, and practically by the emergence of languages such as ALGOL with suitably rich control structures

Structured programming is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. Certain languages such as Ada, Pascal, and Fortran 90 are designed with features that encourage or enforce a logical program structure.
Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function is coded in a separate module or subroutine, allowing the code to be loaded into memory more efficiently. After a module has been tested individually, it is then integrated with other modules into the overall program flow.
Program flow follows a simple hierarchical model that employs looping constructs such as for
  1. repeat,
  2. while and
  3. use of the Go To statement
is prohibited.
Structured programming allows any computer program to be written with just three structures:
  1. decisions,
  2. sequences, and
  3. loops.
Edsger Dijkstra's article, Go To Statement Considered Harmful was significant in the trend towards structured programming. In the methodology employed by Dijkstra, the developer separates programs into subsections that each have only one point of access and one point of exit.