How do I avoid the next developer reading my code swearing at me
summary
A small Shopify integration initially takes weeks to change because of ambiguous types, sprawling JSX, hidden state transitions, and no end-to-end specs; the remedy is concrete: adopt TypeScript discriminated unions so domain cases are explicit, split UI logic into tiny components and hooks for straightforward JSX, encode flows as explicit state machines (or XState) so navigation and data transitions are obvious, and add Cypress integration tests that run with mocked backend responses; these changes collapse ramp-up time and make fixes predictable.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:46Ambiguous code experience
- 3:36Sources of ambiguity
- 5:41User perspective on behavior
- 9:15Internal workflows
- 12:46State machines in React
- 17:02Domain types with unions
- 25:06Breaking down components
- 33:15Clear code benefits
- 35:25Cypress integration Q&A
related talks
12mHow TypeScript Ruined My Life (In a Good Way)
25mIntuitive Tooling
11mThe Joy of Typescript
43mScalable Best Practices for Your Development Team
31mFire-Side Chat with Kent C. Dodds
30mSwipe Left, Uncaught TypeError Learning to Love Type Systems
27mMatthew Gerstman - TypeScript: Seeing Past the Hype
34mSecrets of building robust UI components
