Track 04 of 10Code that stays easy to change

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

  1. Principles at a glanceAll twelve on one map, SOLID, DRY, KISS and YAGNI included, then a game: name the smell.6 min
  2. 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
  3. S: Single responsibilityOne reason to change per module. Watch a small change spread through a 214-line file.6 min
  4. O: Open/closedAdd payment methods to a growing switch until a Friday edit breaks checkout, then plug them in instead.7 min
  5. L: Liskov substitutionPlug four stores into the same function. One crashes, one silently loses your work.7 min
  6. I: Interface segregationFax a contract from a printer that was forced to say it could fax.6 min
  7. D: Dependency inversionRun sign-up tests that email real customers, then plug in a fake in one line.7 min
  8. Separation of concernsData, rules, presentation. Run the same tests against mixed and separated code.6 min
  9. DRY: Don't repeat yourselfOne home for every rule. Change a tax rate copied into three files.5 min
  10. KISS: Keep it simpleCount the hops from a click to the screen: seven, or two.5 min
  11. YAGNI: You aren't gonna need itThirteen props, millions of states, two callers. Build for today.5 min
  12. Composition over configurationBuild a dialog from parts instead of props, then add something nobody planned.6 min
  13. Fail fastSend a broken API response and see where it's caught, if at all.6 min
  14. Least surpriseA real form where “Add tag” secretly submits. Code should do what it says.5 min
  15. When they disagreeThree real dilemmas where the principles pull against each other.5 min