Ask HN: What are your tips for reading other people's code? - autogol
======
Eridrus
Depends on how long you have, how unfamiliar the code/build is and what the
goal is, but spend as much time as reasonable getting tools to work first.

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.

------
NigelR
Read through some of the code with the original author. It may seem obvious
and it's not always possible, but when you can do this you can cut hours off
the time it takes to understand the code and other code that the author wrote.

What you'll get from this that would be more challenging on your own:

\- design tradeoffs

\- high level design

\- the author's coding patterns

