skip to main content
article
Free Access

Structure exits, not loops

Published:01 September 1996Publication History
Skip Abstract Section

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.

References

  1. [CLR90] Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest. Introduction to Algorithms. MIT Press, Cambridge, MA, 1990.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. [Coo93] Doug Cooper. Oh! Pascal! (Third Edition). W.W. Norton, New York, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. [Knu74] Donald E. Knuth. Structured programming with go to statements. Computing Surveys, 6(4):261-301, December 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. [Kof92] Eliot B. Koffman. Pascal: Problem Solving and Program Design (Fourth Edition). Addison-Wesley, Reading, MA, 1992.Google ScholarGoogle Scholar
  5. [Lon70] Ralph L. London. Certification of algorithm 245: Treesort 3. Communications of the ACM, 13(6):371-373, June 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. [Man74] Zohar Manna. Mathematical Theory of Computation . McGraw-Hill, New York, 1974.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. [Rob95] Eric S. Roberts. Loop exits and structured programming: Reopening the debate. In Twenty-Sixth SIGCSE Technical Symposium, pages 268- 272, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. [Sed88] Robert Sedgewick. Algorithms (Second Edition). Addison-Wesley, Reading, MA, 1988.Google ScholarGoogle Scholar
  9. [Wir76] Niklaus Wirth. Algorithms + Data Structures = Programs. Prentice-Hall, Englewood Cliffs, NJ, 1976.Google ScholarGoogle Scholar

Index Terms

  1. Structure exits, not loops

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM SIGCSE Bulletin
                ACM SIGCSE Bulletin  Volume 28, Issue 3
                Sept. 1996
                68 pages
                ISSN:0097-8418
                DOI:10.1145/234867
                Issue’s Table of Contents

                Copyright © 1996 Author

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 1 September 1996

                Check for updates

                Qualifiers

                • article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!