4 ms·
I'm still not exactly sure what the author means by Don't Repeat Knowledge I think they're assuming that everyone has read The Pragmatic Programmer. To quote t
by crispinb 7y ago
I'm still not exactly sure what the author means by Don't Repeat Knowledge
I think they're assuming that everyone has read The Pragmatic Programmer. To quote the original DRY principle from there:
Every piece of knowledge must have a single, unambiguous, authoritative representation within the system
Note that this has only an accidental relationship with code duplication, and in some cases could increase the latter.
- rileymat2 7y agoMore often than not duplicate code is duplicate knowledge. It often is an implicit business rule that links several statements together or a system requirement like freeing db connections and locks in the right order after use.
- loopz 7y agoDRY skips the part about dependency management: Will tying these parts together make sense for future readability, changability, or not? Often it is wise to be clear what and how to separate and encapsulate. If there is only one right way, there is no reason for change or changing together, so is not shared knowledge.