Ask HN: What are your tips for reading other people's code? |
Ask HN: What are your tips for reading other people's code? |
Make sure you can figure out what function is actually getting called when you see a function name. Tools like Source Insight can be useful if you need to get up and running quickly since they support very loose searching rules. I've also heard good things about SciTools Understand, but never used it myself.
The best thing though would be to get the software running in a way that you can debug it. Being able to step through code and see how data is modified and which particular implementation of an interface gets called, etc, can be very helpful.
Being able to exercise the code in question always makes it easier to understand because you can think about it in larger blocks than trying to form an picture of the larger goal line by line.
What you'll get from this that would be more challenging on your own:
- design tradeoffs
- high level design
- the author's coding patterns