summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Kerr <dwmkerr@gmail.com>2019-05-20 22:47:39 +0800
committerGitHub <noreply@github.com>2019-05-20 22:47:39 +0800
commitafbb055ea3844faccaa46d998f017c8b51589f9a (patch)
tree50fbb1182ac1613f23a5448e3a7212570b8793e8
parent64640cbe1ad6081f561548b0108cc904a5286272 (diff)
parent2b9996292f5757bb7b3a78bfa7d0447ce1b12329 (diff)
Merge pull request #93 from jlozovei/master
add DRY Principle
-rw-r--r--README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index 18527d4..fb0faa8 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ Laws, Theories, Principles and Patterns that developers will find useful.
* [The Liskov Substitution Principle](#the-liskov-substitution-principle)
* [The Interface Segregation Principle](#the-interface-segregation-principle)
* [The Dependency Inversion Principle](#the-dependency-inversion-principle)
+ * [The DRY Principle](#the-dry-principle)
* [Reading List](#reading-list)
* [TODO](#todo)
@@ -391,6 +392,22 @@ See also:
- [Inversion of Control](#todo)
- [Dependency Injection](#todo)
+### The DRY Principle
+
+[The DRY Principle on Wikipedia](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
+
+> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
+
+DRY is an acronym for _Don't Repeat Yourself_. This principle aims to help developers reducing the repetition of code and keep the information in a single place and was cited in 1999 by Andrew Hunt and Dave Thomas in the book [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
+
+> The opposite of DRY would be _WET_ (Write Everything Twice or We Enjoy Typing).
+
+In practice, if you have the same piece of information in two (or more) different places, you can use DRY to merge them into a single one and reuse it wherever you want/need.
+
+See also:
+
+- [The Pragmatic Developer](https://en.wikipedia.org/wiki/The_Pragmatic_Programmer)
+
## Reading List
If you have found these concepts interesting, you may enjoy the following books.