Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M4160

Don't Repeat Yourself

Don't Repeat Yourself
BusinessHigh supportManagement
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

"Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of information which is likely to change, replacing it with abstractions that are less likely to change, or using data normalization which avoids redundancy in the first place. The DRY principle is stat…

Definition

"Don't repeat yourself." Every piece of knowledge or logic in a system should have a single, unambiguous, authoritative representation. If you write the same code in two places and change one but forget the other, bugs arise. Scaffold use: single point of truth. In company management, ensure the "Source of Truth" is unique. Do not maintain two different customer lists, and do not have two departments responsible for the same thing. Redundancy is the source of chaos.

How to use

Single point of truth. In company management, ensure the "Source of Truth" is unique. Do not maintain two different customer lists, and do not have two departments responsible for the same thing. Redundancy is the source of chaos.

Mechanism

"Don't Repeat Yourself" — every piece of knowledge or logic in a system should have a **single, unambiguous, authoritative representation (Single Source of Truth)**. Repetition means that modifications require syncing multiple places, and any omission leads to inconsistency and bugs. The mechanism is to replace "copy/paste" with "abstraction/reference".

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Two places with the same tax calculation logic; changing one but forgetting the other causes accounting errors — merging into a single function eliminates the risk. In organizations, also maintain only one master customer data.

Common pitfalls

  • - Over-abstracting to "avoid repetition" can make code harder to understand and maintain (DRY is not about never writing a second line of code); - Forcibly merging things that are only coincidentally similar (not the same knowledge); - Ignoring the trade-off between "synchronization cost" and "understanding cost".
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Don%27t_repeat_yourselfZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS