The DRY programming principle

The DRY (Don’t repeat yourself) programming principle involves breaking down a large system, such as software you’ve developed, into smaller, non-repeating components. If you have multiple components that perform the same tasks, the DRY principle requires that you reduce their number, ideally so that each component is unique.

Once a system has been divided into components responsible for performing well-defined tasks, they can be organized into classes, which is called a modular architecture.

To correctly build a system according to the DRY principle, it is necessary to adhere to the following rules:

See also

  • principle SOLID,
    which sets guidelines for OOP-based software
  • principle KISS,
    which involves abandoning the complication of software
  • principle YAGNI,
    which involves the rejection of redundant software functionality
  • principle CQS,
    which specifies only one command for each function
  • principle LoD,
    which is used in software development
  • responsibility separation principle,
    which is used in software development