principles:don_t_repeat_yourself
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
principles:don_t_repeat_yourself [2025-08-28 10:01] – created hildegardlahey6 | principles:don_t_repeat_yourself [2025-08-31 14:09] (current) – old revision restored (2021-10-18 21:27) christian | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | (Image: [[https:// | + | ====== Don't Repeat Yourself |
- | Born from 1960s design labs, cocoon chairs were made to wrap around your body, giving you your own private bubble — even in busy spaces. Today’s versions come in fibreglass shells, often paired with teddy fur padding. | + | ===== Variants and Alternative Names ===== |
- | From open-plan apartments to design-led studios, cocoon-style seating is being used to soften hard architecture. | + | * Single Point of Truth (SPOT) |
+ | * Single Source of Truth (SSOT) | ||
- | **Why They Work:** | + | ===== Context ===== |
- | - Soft silhouettes that feel safe | + | |
- | - Natural sound dampening | + | |
- | - Bold shapes that photograph well | + | |
- | - Blends mid-century with modern vibes | + | |
- | [[// | + | * [[contexts: |
+ | * [[contexts: | ||
+ | ===== Principle Statement ===== | ||
- | Want one for your space? We’ve curated iconic cocoon pieces | + | > "Every piece of knowledge must have a single, unambiguous, |
+ | |||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | DRY not only states that code duplication shall be avoided. Rather DRY is a general rule that states that if there is duplication, | ||
+ | |||
+ | |||
+ | ===== Rationale ===== | ||
+ | |||
+ | If there are several representations of the same information (be it code or any other form of information), | ||
+ | |||
+ | |||
+ | ===== Strategies ===== | ||
+ | |||
+ | * Add a new invokable module (a function, a method, a class, etc.) instead of duplicating code | ||
+ | * Factor out a common base class | ||
+ | * Use code generation when information has to be represented in multiple forms | ||
+ | * Use polymorphism to avoid repeatedly enumerating a set of possible solutions in if or switch statements | ||
+ | |||
+ | ===== Caveats ===== | ||
+ | |||
+ | See section [[#contrary principles]]. | ||
+ | |||
+ | |||
+ | ===== Origin ===== | ||
+ | |||
+ | {{page> | ||
+ | ===== Evidence ===== | ||
+ | /* Comment out what is not applicable and explain the rest: */ | ||
+ | /* * [[wiki: | ||
+ | |||
+ | * [[wiki: | ||
+ | * [[wiki: | ||
+ | |||
+ | /* * [[wiki: | ||
+ | |||
+ | |||
+ | ===== Relations to Other Principles ===== | ||
+ | |||
+ | ==== Generalizations ==== | ||
+ | |||
+ | * [[Murphy' | ||
+ | |||
+ | ==== Specializations ==== | ||
+ | |||
+ | * [[Once And Only Once]] (OAOO): This is the aspect of DRY which is concerned with the avoidance of (code) duplication. | ||
+ | * [[Single Choice Principle]] (SCP): Duplication can also be duplication of information about a set of possibilities. The SCP is about this aspect. | ||
+ | * [[Write Code That Writes Code]]: This is the code generation aspect of DRY. | ||
+ | |||
+ | ==== Contrary Principles ==== | ||
+ | |||
+ | * [[Keep It Simple Stupid]] (KISS): Especially code generators can be very complex. | ||
+ | |||
+ | ==== Complementary Principles ==== | ||
+ | |||
+ | * [[Generalization Principle]] (GP): A generalized solution avoids duplication. | ||
+ | |||
+ | ==== Principle Collections ==== | ||
+ | |||
+ | {{page> | ||
+ | {{page> | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | |||
+ | ===== Description Status ===== | ||
+ | /* Choose one of the following and comment out the rest: */ | ||
+ | / | ||
+ | [[wiki: | ||
+ | / | ||
+ | |||
+ | |||
+ | ===== Further Reading ===== | ||
+ | |||
+ | * [[wiki> | ||
+ | * [[wp> | ||
+ | * [[http:// | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | |||
+ | Discuss this wiki article and the principle on the corresponding [[talk: | ||
- | Shop the latest — and take a seat in the future. |
principles/don_t_repeat_yourself.1756368097.txt.gz · Last modified: by hildegardlahey6