Don't miss an insight. Subscribe to Techopedia for free.


DRY Principle

What Does DRY Principle Mean?

The DRY principle is one of those long-standing ideas in computer science that is talked about with a bit of humor. DRY stands for "don’t repeat yourself," and a corresponding WET principle stands for "write everything twice." The DRY principle is often attributed to Andrew Hunt and David Thomas, whose book, the Pragmatic Programmer, came out in 2000.


Techopedia Explains DRY Principle

The idea of the DRY principle is that, using efficiencies and eliminating redundancies, programmers can make code more efficient and easy to change. At the heart of the DRY principle is the re-use of code modules. For instance, coding a repeatable task as a function means that function can be inserted and re-used anywhere in the code, and does not have to be re-written for various calls. Benefits of using the DRY principle include code readability and ease of maintenance.


Related Terms