A simple technique to motivate structured programming

  • Authors:
  • Terry Flaherty

  • Affiliations:
  • Loyola Univ., New Orleans, LA

  • Venue:
  • SIGCSE '88 Proceedings of the nineteenth SIGCSE technical symposium on Computer science education
  • Year:
  • 1988

Quantified Score

Hi-index 0.00

Visualization

Abstract

Programs with only sequence, selection, and iteration control structures (structured programs) are more understandable and changeable than programs with unrestricted control structures (flowchart programs). However, flowcharts are intuitive, simple, and easy to follow step by step. The transition from teaching general flowcharts to structured ones is usually made by postulating the standard structured flowchart patterns without much justification. The present method establishes the correspondence between flowcharts and structured programs via sets of computations. The student examines a set of computations of a flowchart program and describes the general structure with a regular expression. A structured program that corresponds to this regular expression is constructed. In this way, the student is led to (1) see the difference between program and computation, (2) see how “structure” arises, (3) see that a structured program is one whose textual structure is identical to the structural description of its computations, (4) appreciate the cognitive simplicity of structure descriptions versus flowcharts.