Dave Thomas says, "Don't Repeat Yourself, or 'DRY,' says that every piece of system knowledge should have one authoritative, unambiguous representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation."---xj40dkcfea73---Dave Thomas says, "Don't Repeat Yourself, or 'DRY,' says that every piece of system knowledge should have one authoritative, unambiguous representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation."
Read this interview with Pragmatic Programmers Andy Hunt and Dave Thomas:
http://www.artima.com/intv/dry.htmlHere's another excerpt:
Andy Hunt: Creating a code generator is an investment. You're banking that it will be cheaper in the long run to build the code generator, because as changes come up you can simply tweak the input to the code generator and regenerate the byproducts. Without a code generator, you will have to manually make changes by hand each time to all the byproducts. If you expect a lot of volatility, a code generator can be a good investment.
Dave Thomas: In fact, I'd go further. Typically, if I build a code generator, chances are good I will generate the products manually first. And only when I come back to it will I say, "I'm now in a situation where I need to automate this." That approach has two benefits. First, I might never come back, in which case I don't have to write the code generator. If I do come back, I've already validated the code generator's output. So I don't just march off into the unknown, I actually aim at a definite target. What do you think of Andy and Dave's comments?