Don't repeat yourself
From CSSEMediaWiki
Revision as of 05:16, 16 July 2010 by Lukas Korsika (Talk | contribs)
Dave Thomas says it nicely on this web page.
- "DRY says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation."
Note that this does not mean that there cannot be more than one representation of every piece of knowledge, just that one should be authoritative and unambiguous. Often it is necessary to duplicate representations for reasons including performance, eg caches, and readability/programmer convenience, eg compiled object files duplicate the knowledge in source files. Such duplication should always be mechanically reproducible (ie, ./update-cache.sh and it's magically fixed), and generated from the One True Knowledge Item.