4 ms·
Ask HN: How do I dive into a bigger codebase?
All I have done till now is write and read code which was small in size. How do I get started with reading a bigger codebase? For ex. The Chromium Project, etc
- MarkCole 11y agoHaving recently done this what I like to do is perform some actions, and follow it through the codebase. So for example on a web project, what happens when I hit the index page? First it hits the router/dispatcher, it is handed off to this controller, the controller calls the database. Etc. So for the chromium project I'd try to work my way through, by performing an action. Then asking how it is performed, and follow the code through. Hope this helps.
- lastofus 11y agoI sometimes like to pick a module, set a breakpoint in a debugger, and start stepping through it to see where it takes me.
- hacknat 11y agoI'm reiterating what's already been said by others, but as more explicit instructions: 1. Download the code and figure out how to build it. 2. Figure out how to run it. 3. Figure out how to attach a debugger to it. 4. Figure out where to listen/break for an event whose purpose you pretty much understand (like the initial DNS request). 5. Follow the code down the rabbit-hole, you'll be amazed at how quickly it connects you to everything else in the code.
- brudgers 11y agoIt looks like the git repository is 22GB or 6.5GB without the commit history. I doubt a person can read that much in a lifetime. So I guess the best approach depends on finer grained goals.