~/talk

You Might Not Need Classes

slides:none on file

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

  1. 0:00Start
  2. 0:29You might not need classes
  3. 0:59Issues and pitfalls
  4. 1:18ECMAScript 2015
  5. 1:38Prototype vs Class
  6. 2:46Improvement over prototype
  7. 3:26False expectations
  8. 5:25Context binding
  9. 7:56Harder to optimize
  10. 8:31Plain functions
  11. 8:57Closures
  12. 10:55Object composition
  13. 11:50Modules
  14. 13:31Watch out for context issues
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.