DRY: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
''Don't Repeat Yourself'' | ''Don't Repeat Yourself'' (DRY) principle sys: "Every piece of knowledge should have a single, unambiguous, authoritative representation within a system." | ||
If you are in the position to write the second time the same behavior (copy-and-paste) that means the behavior belongs into a reusable function. Duplication forces people to make a change in multiple places, and that is not good. | |||
=DRY and Coupling= | =DRY and Coupling= |
Revision as of 21:57, 3 January 2022
Internal
Overview
Don't Repeat Yourself (DRY) principle sys: "Every piece of knowledge should have a single, unambiguous, authoritative representation within a system."
If you are in the position to write the second time the same behavior (copy-and-paste) that means the behavior belongs into a reusable function. Duplication forces people to make a change in multiple places, and that is not good.
DRY and Coupling
Organizatorium
- The "rule of three" for software reuse suggests the you should turn something into a reusable component when you find three places that you need to use it. https://blog.codinghorror.com/the-delusion-of-reuse/ Facts and Fallacies of Software Engineering https://www.amazon.com/exec/obidos/ASIN/0321117425/