You Might Not Need Classes
summary
Argues that classes are syntactic sugar over prototypes and so create leaky abstractions and false expectations; demonstrates with a counter and a button example how unbound methods break when this runs as an event handler and shows that binding moves methods to instances (losing prototype sharing). Proposes concrete alternatives: factory functions using closures for private state, simple object composition instead of inheritance, and module-scoped singletons. Notes practical consequences: harder optimization, larger bundles, and tooling hiccups like hot reload.
AI-written summary · about
chapters (14)
- 0:00Start
- 0:29You might not need classes
- 0:59Issues and pitfalls
- 1:18ECMAScript 2015
- 1:38Prototype vs Class
- 2:46Improvement over prototype
- 3:26False expectations
- 5:25Context binding
- 7:56Harder to optimize
- 8:31Plain functions
- 8:57Closures
- 10:55Object composition
- 11:50Modules
- 13:31Watch out for context issues








