How to Read an Unfamiliar Codebase: gporca as an Example
Opening a 400K-line optimizer, the first question is usually “where do I start”. The answer isn’t line one — it’s one complete call path. 1. Four steps Step Goal How 1. Find the entry know where execution starts main → init → handling one query 2. Read the data structures know where state lives structs, containers, memo/group objects 3. Follow the control flow see one task complete breakpoints or logging on a minimal input 4. Change one thing prove you understood flip a branch, check the output changes as expected Step 4 is the point: reading without changing is usually an illusion of understanding. ...