a day ago
- Peter Naur argued that programming is theory building and that recovering a program's theory solely from code and documentation is impossible, but the author disagrees and provides methods to do so.
- Theory modification is real and happens over time as team members change; you'll never recover the exact original theory, only create a new one.
- To rebuild a theory, start with a specific goal and focus on the relevant parts of the program, using techniques like searching error messages, backtraces, or known names.
- Reading source code is key: use an LSP to find all call sites, skim callers, and run mini experiments (e.g., exit(1), logging, debuggers) to verify understanding.
- When writing new code, copy small snippets (10–15 lines) from the existing codebase and match its style to reduce bugs and please maintainers.
- Testing is crucial: find existing tests, run them before changes, and create new tests early to verify your emerging theory.
- Iteration time matters; learn how to run individual tests and document your process via CONTRIBUTING.md or README files.