Andrew's Digital Garden

DRY

Don't repeat yourself. Each piece of knowledge must have a single, unambiguous, authoritative representation within a system.

It's more concerned with knowledge/intent duplication than code duplication.

The test for DRY is to make a change, and see how many places and formats you have to make that change in.

Don't duplicate code into documentation either - explicit documentation that needs to be changed when the code is changed is somewhat pointless.

Don't duplicate data either, calculate fields based on other fields, rather than duplicating.

Be wary of [[refactoring]] too early. [[20211115112656-rule-of-three]]

[[20200307101703-easy-to-change]]

[[principles]]

DRY