principles:don_t_repeat_yourself
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| principles:don_t_repeat_yourself [2025-08-28 02:39] – 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: | ||
| - | The cocoon chair is trending hard again — and it’s not hard to see why. These stylish pods offer a hug-like vibe that screams comfort, | + | ====== Don't Repeat Yourself (DRY) ====== |
| - | Originally seen in mid-century homes, cocoon chairs were made to enclose the sitter, giving you your own quiet space — even in busy spaces. Today’s versions come in rattan frames, often paired with teddy fur padding. | + | ===== Variants and Alternative Names ===== |
| - | From contemporary townhouses 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 ===== |
| - | - Orb-like shapes that feel safe | + | |
| - | - Natural sound dampening | + | |
| - | - Instant design credibility | + | |
| - | - Blends mid-century with modern vibes | + | |
| - | Designers and style-savvy homeowners are using cocoon chairs to define lounge areas. Add a floor lamp and a rug — it’s ready for Pinterest. | + | * [[contexts: |
| + | * [[contexts: | ||
| + | ===== Principle Statement ===== | ||
| - | Thinking | + | > "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 Cacoon swing pod claim your pod. | ||
principles/don_t_repeat_yourself.1756341564.txt.gz · Last modified: by hildegardlahey6
