A SOLID takedown of OOP
summary
Argues that SOLID’s goals—lowering blast radius and easing evolution—are achievable without class-based OOP, using TypeScript examples instead of heavyweight hierarchies. Demonstrates a shapes example where class inheritance creates the circle/ellipse problem while composition via functions, interfaces, records, modules avoids it; shows an importer implemented as a pure function returns a record and scales under concurrency where a stateful importer breaks; exposes stack race conditions and promotes immutable data. Uses Node/TypeScript tooling (first TS issue #306 → ~50,000) and finds the functional approach simpler and effective.
AI-written summary · about
chapters (21)
- 0:00Introduction and context
- 1:08From OOP advocate to critic
- 3:15JavaScript and TypeScript shift
- 5:01Talk overview and goals
- 8:07FIRM building blocks explained
- 10:14SOLID principles and coupling
- 11:39OOP pillars overview
- 12:22Inheritance pitfalls
- 15:32Shapes example Ryu vs Chun
- 18:44Encapsulation benefits and flaws
- 20:50Stack encapsulation example
- 25:02Document importer class critique
- 27:29Pure function alternative
- 28:10Concurrency and encapsulation
- 30:56Encapsulation alternatives
- 33:21Domain driven design critique
- 35:04Abstraction and type systems
- 37:12Classes as types limitations
- 38:15Type expression challenges
- 41:27Service evolution example
- 44:12Conclusion and summary
