Perl Style: Reduce Complexity

  • But place next and redo near the top of the loop when possible.
  • Use unless and until.
  • But don’t use unless ... else ...
  • Escape the tyranny of Pascal. Don’t go through silly contortions to exit a loop or a function only at the bottom. Don’t write:

        while (C1) {
            if (C2) {
                statement;
                if (C3) {
                    statements;
                }
            } else {
                statements;
            }
        }
    

Forward to Reduce Complexity (solution)
Back to Avoid Gratuitous Backslashes
Up to index

Copyright © 1998, Tom Christiansen All rights reserved.

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub