Search

Lessons (3)

  • Code Smells & Refactoring

    … this.currency }).format(this.cents / 100); } } Switch statements → Polymorphism js // ❌ This switch is repeated in area(), perimeter(), draw …

  • O — Open/Closed Principle

    … classes, functions, config), not editing tested code. - Use polymorphism, strategy maps, plugins or middleware to create extension points …

  • L — Liskov Substitution Principle

    … Prefer composition or separate types. - LSP is what makes polymorphism (and the Open/Closed Principle ) safe.