Track 04 of 10Code that stays easy to change
- 01Principles at a glance
- 02SOLID principles at a glance
- 03S: Single responsibility
- 04O: Open/closed
- 05L: Liskov substitution
- 06I: Interface segregation
- 07D: Dependency inversion
- 08Separation of concerns
- 09DRY: Don't repeat yourself
- 10KISS: Keep it simple
- 11YAGNI: You aren't gonna need it
- 12Composition over configuration
- 13Fail fast
- 14Least surprise
- 15When they disagree
Track 04 of 10
Code that stays easy to change
SOLID, DRY, KISS, YAGNI and four everyday habits. Start with the map, then flip each principle from without to with in a live demo.
15 lessons · about 89 minutes
- Principles at a glanceAll twelve on one map, SOLID, DRY, KISS and YAGNI included, then a game: name the smell.6 min
- SOLID principles at a glanceThe five letters in one line each. Fix a checkout that breaks all five, one letter at a time.7 min
- S: Single responsibilityOne reason to change per module. Watch a small change spread through a 214-line file.6 min
- O: Open/closedAdd payment methods to a growing switch until a Friday edit breaks checkout, then plug them in instead.7 min
- L: Liskov substitutionPlug four stores into the same function. One crashes, one silently loses your work.7 min
- I: Interface segregationFax a contract from a printer that was forced to say it could fax.6 min
- D: Dependency inversionRun sign-up tests that email real customers, then plug in a fake in one line.7 min
- Separation of concernsData, rules, presentation. Run the same tests against mixed and separated code.6 min
- DRY: Don't repeat yourselfOne home for every rule. Change a tax rate copied into three files.5 min
- KISS: Keep it simpleCount the hops from a click to the screen: seven, or two.5 min
- YAGNI: You aren't gonna need itThirteen props, millions of states, two callers. Build for today.5 min
- Composition over configurationBuild a dialog from parts instead of props, then add something nobody planned.6 min
- Fail fastSend a broken API response and see where it's caught, if at all.6 min
- Least surpriseA real form where “Add tag” secretly submits. Code should do what it says.5 min
- When they disagreeThree real dilemmas where the principles pull against each other.5 min