Software Architecture/Mobile Development
Dan Abramov·Jan 25, 2019·6 min readBy Dan Abramov
DebuggingSecuritySoftware ArchitectureReactAPI DesignBest Practices
AI summary
This article introduces 'Bug-O' notation as a mental model for evaluating API design based on how debugging complexity scales with codebase growth. The author compares imperative DOM manipulation, which suffers from combinatorial explosion of states, with declarative component-based abstractions that enforce predictable state boundaries.
Key points
- Bug-O notation measures the difficulty of debugging as a function of codebase growth.
- Imperative code with side effects creates a combinatorial explosion of execution paths, making it hard to debug as complexity increases.
- Declarative abstractions and strict state boundaries limit the number of possible execution paths.
- Predictable component trees allow for tracing UI state changes relative to the tree depth rather than total app size.