In defense of not understanding your codebase
3 hours ago
- Software engineers have differing views on codebase understanding: small, low-turnover teams advocate complete understanding, while large, high-turnover teams accept partial understanding.
- Peter Naur's 'Programming as Theory Building' argues that code is a by-product of a programmer's 'theory of the program,' but his conclusion that code should be discarded when theory is lost is impractical for large systems.
- Large software systems cannot be rebuilt from scratch due to countless quirks; rewrites must occur incrementally by carving out small chunks.
- Abandoned codebases can be revived by engineers starting with one flow and gradually expanding understanding, even without original team members.
- In sufficiently large codebases, everyone operates with a partially incorrect theory; effectiveness requires making educated guesses and dealing with consequences.
- Maintaining a theory of the codebase is just one engineering value among many, often traded off for speed, legal compliance, or other priorities.
- LLMs hinder detailed theory building but enable quick partial theories and effective leverage, representing a complex tradeoff.
- Other factors that impede theory maintenance include team turnover, legal requirements, security patches, and dependencies.