Stage 5 · Lesson 5 of 10
DRY, KISS and YAGNI
These are three short principles that work best as questions while refactoring (tidying code without changing what it does). means do not repeat yourself. If the same rule is written in three places, one day only two get updated, so give it one home.
KISS means keep it simple: prefer the plainest solution that works over a clever one. YAGNI means you are not going to need it. Do not build options, settings or abstractions for a future that may never come.
The three pull against each other. Removing every trace of duplication often adds a confusing abstraction, so a common rule of thumb is to wait for the third copy. Apply them to working code, not to a blank page.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking SOLID Design Principles
Design Gurus · Beginner · $50 one-time
Five principles with code examples, including when applying them makes code worse
- GuideFreeRefactoring.Guru: Code Smells and Refactoring
Refactoring.Guru · Beginner
Free catalogue of code smells and the small refactorings that fix each one