Structure exits, not loops

  • Authors:
  • Mordechai Ben-Ari

  • Affiliations:
  • Weizmann Institute of Science, Rehovot, Israel

  • Venue:
  • ACM SIGCSE Bulletin
  • Year:
  • 1996

Quantified Score

Hi-index 0.00

Visualization

Abstract

Until recently, Pascal was the first programming language taught to students. As more schools choose Ada or C++ as a first language, the debate on structured programming has been reopened ([Rob95]). We are no longer restricted to the while-statement: exit/break-statements can be used to exit a loop from the middle, and return from a procedure or function is allowed within a loop statement. Do these constructs violate the principle of structure programming? This article claims that more general loop constructs can be objectively justified, because they simplify the verification of programs. A program that is simple to verify is also easy to explain and understand.