Inheritance vs Composition
summary
Compares class-based inheritance to functionally composed pipes and finds composition easier to evolve: initial popover UI spawns five brittle subclasses, markdown rendering forces forking to add truncation, and jQuery sortable lacks hooks for creating drag gaps. Recommends separating state from behavior and passing a small state object through pure functions, implemented with React and Redux, aided by Ramda, applied during a slow migration from Backbone while serving 4.5 million users, and noting issues with jQuery sortable.
AI-written summary · about
chapters (11)
- 0:00Introduction to Meister Labs
- 1:02Legacy tech challenges
- 2:13The limitations of inheritance
- 5:18Adopting react for UI
- 7:15Challenges with third-party code
- 9:03The concept of composition
- 10:43Applying composition in JS
- 12:35Data-driven UI management
- 14:15Summary and best practices
- 15:26Functional programming in JS
- 17:30Q&A and company opportunities
related talks
52mCompose Yourself! Different Kinds of Composables
30mCompose All the Things
46mWho needs Inheritance and composition
25mWhat can we learn from Jetpack Compose?
40mRethinking UI: Imperative to Declarative
01h 01mThe Power of Composition
35mAdvanced patterns in building React Components
01h 02mThe Power of Composition
