5 lessons about 1 hoursStarts at: Intermediate

SOLID Principles

Each principle shown as a bad example first, then what actually goes wrong, then a version that is easier to change.

Start with lesson 1
Your progress on this device0/5 (0%)

Lessons in order

  1. 01Intermediate 14 min

    Single Responsibility — One Reason to Change

    A class should have one reason to change. See a class doing four jobs, what breaks because of it, and the version that survives change.

  2. 02Intermediate 13 min

    Open/Closed — Extend Without Editing

    Add new behaviour by adding code, not by modifying code that already works. See the growing if/elif chain and the version that replaces it.

  3. 03Intermediate 14 min

    Liskov Substitution — Subclasses Must Fit

    Any subclass must work anywhere its parent works. See the classic broken hierarchy, why it fails, and how to model it correctly.

  4. 04Intermediate 12 min

    Interface Segregation — Small Contracts

    No class should be forced to implement methods it does not need. See a fat interface, the empty methods it produces, and the split that fixes it.

  5. 05Intermediate 14 min

    Dependency Inversion — Depend on Contracts

    High-level logic should not depend on low-level details. Learn how injecting dependencies makes code testable, swappable and honest.

Other tracks