3.7. Tips for Reducing Complexity

“Complexity is the enemy, and our aim is to kill it.”

Jan Baan

One of Perl's greatest strengths is its expressiveness and extreme conciseness. Complexity is the bane of software development: when a program grows beyond a certain size, it becomes much harder to test, maintain, read, or extend. Unfortunately, today's problems mean this is true for every program we need. Anything you can do to minimize the complexity of your program will pay handsome dividends.

The complexity of a program is a function of several factors:

  • The number of distinct lexical tokens

  • The number of characters

  • The number of branches in which control can pass to a different point

  • The number of distinct program objects in scope at any time

Get Perl Debugged now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.