principles:don_t_repeat_yourself
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
principles:don_t_repeat_yourself [2020-10-12 14:01] – old revision restored (2013-02-18 17:24) 159.69.186.191 | principles:don_t_repeat_yourself [2021-10-18 21:27] – old revision restored (2015-06-26 15:45) christian | ||
---|---|---|---|
Line 9: | Line 9: | ||
* [[contexts: | * [[contexts: | ||
+ | * [[contexts: | ||
===== Principle Statement ===== | ===== Principle Statement ===== | ||
Line 28: | Line 28: | ||
* Add a new invokable module (a function, a method, a class, etc.) instead of duplicating code | * Add a new invokable module (a function, a method, a class, etc.) instead of duplicating code | ||
+ | * Factor out a common base class | ||
* Use code generation when information has to be represented in multiple forms | * Use code generation when information has to be represented in multiple forms | ||
* Use polymorphism to avoid repeatedly enumerating a set of possible solutions in if or switch statements | * Use polymorphism to avoid repeatedly enumerating a set of possible solutions in if or switch statements | ||
Line 38: | Line 39: | ||
===== Origin ===== | ===== Origin ===== | ||
- | Andrew Hunt and David Thomas: // | + | {{page> |
- | + | ||
===== Evidence ===== | ===== Evidence ===== | ||
/* Comment out what is not applicable and explain the rest: */ | /* Comment out what is not applicable and explain the rest: */ | ||
/* * [[wiki: | /* * [[wiki: | ||
- | /* * [[wiki: | ||
- | * [[wiki: | + | |
+ | | ||
/* * [[wiki: | /* * [[wiki: | ||
Line 65: | Line 64: | ||
==== Contrary Principles ==== | ==== Contrary Principles ==== | ||
- | * [[Keep It Simple Stupid]]: Especially code generators can be very complex. | + | * [[Keep It Simple Stupid]] |
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
Line 76: | Line 75: | ||
{{page> | {{page> | ||
- | ===== Example | + | ===== Examples |
===== Description Status ===== | ===== Description Status ===== | ||
/* Choose one of the following and comment out the rest: */ | /* Choose one of the following and comment out the rest: */ | ||
- | [[wiki: | + | /*[[wiki: |
- | /*[[wiki: | + | [[wiki: |
/ | / | ||
Line 92: | Line 91: | ||
* [[http:// | * [[http:// | ||
+ | ===== Discussion ===== | ||
+ | |||
+ | Discuss this wiki article and the principle on the corresponding [[talk: |
principles/don_t_repeat_yourself.txt · Last modified: 2021-10-18 21:27 by christian