Invisible Code
summary
Claim: shared mutable state hides behavior and causes bugs. Examples: an order service file of ~1,000 lines with a processOrder function ~20 lines depends on a payment service kept as a singleton and run on 100 threads, which mixes payments across requests and nearly causes a production outage. Fixes demonstrated include return values instead of in-place mutation, lifting reads/writes to clearer boundaries, and isolating UI state with render props. Libraries cited: Mostly Adequate Guide, Fantasy Land, Elm, Haskell, Rust.
AI-written summary · about
chapters (7)
- 0:00Introduction to mutable state
- 1:41Hiding changes in state
- 3:56Unpredictable behavior
- 8:10Time-dependent logic
- 10:11Dependency trees and ownership
- 20:26Exponential complexity
- 25:05Resources and conclusion








