© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
V. SarcarSimple and Efficient Programming with C# https://doi.org/10.1007/978-1-4842-8737-8_5

5. Use the DRY Principle

Vaskaran Sarcar1  
(1)
Kolkata, West Bengal, India
 
This chapter discusses the don’t repeat yourself (DRY) principle. It is another important principle that a professional coder follows when writing a piece of code in an application. The SRP and OCP principles that you learned about in Chapter 4 are also related to the DRY principle. Andy Hunt and Dave Thomas first wrote about this principle in their book The Pragmatic Programmer. The DRY principle is stated as follows:
  • Every piece of knowledge must have a single, unambiguous, authoritative representation ...

Get Simple and Efficient Programming with C#: Skills to Build Applications with Visual Studio and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.