Stage 5 of 6 · 10 lessons · ~2 months
Object-oriented design and clean code
Organise programs so they stay readable as they grow: classes where they help, separation of concerns, small functions, tests first on the logic that matters, and documentation someone else can follow.
Start: Classes, objects and encapsulationLessons· one lesson for each topic, in this order
- 1Classes, objects and encapsulationLesson
- 2Composition, inheritance and interfacesLesson
- 3Naming and small functionsLesson
- 4Separation of concernsLesson
- 5DRY, KISS and YAGNILesson
- 6Unit tests and edge casesLesson
- 7Test-driven developmentLesson
- 8Code smells and refactoringLesson
- 9Comments, docstrings and READMEsLesson
- 10SOLID as review questionsOptionalLesson
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
Practise
Keep handy
Also worth your time
Before moving on: Refactor one of your earlier programs: split input, logic and output into separate modules, remove the duplication, write unit tests for the core logic first, and add a README that explains how to run it.

Use a class when it groups data with the behaviour that changes it, not because a tutorial made everything a class. Treat DRY, KISS, YAGNI and SOLID as questions to ask while refactoring, not rules for a first draft, and write the test before you fix any bug.