Ada 95 Quality and Style Guide Chapter 5

Chapter 5: Programming Practices - TOC - 5.1 OPTIONAL PARTS OF THE SYNTAX

5.1.3 Exit Statements

guideline

  • Use loop names on all exit statements from nested loops.

  • example

    See the example in 5.1.1.

    rationale

    An exit statement is an implicit goto. It should specify its source explicitly. When there is a nested loop structure and an exit statement is used, it can be difficult to determine which loop is being exited. Also, future changes that may introduce a nested loop are likely to introduce an error, with the exit accidentally exiting from the wrong loop. Naming loops and their exits alleviates this confusion. This guideline is also useful if nested loops are broken over a screen or page boundary.


    < Previous Page Search Contents Index Next Page >
    1 2 3 4 5 6 7 8 9 10 11
    TOC TOC TOC TOC TOC TOC TOC TOC TOC TOC TOC
    Appendix References Bibliography