Re:Ask HN: How do you "read"/understand/interpret existing c...
by _delirium on Tuesday August 23, 2011 @09:06PM
(#2919010)
I haven't found a good skimming solution to this. If there's no good documentation, interface, variable naming, or other hint to what it's doing, it either has to fit a code pattern you recognize easily, or else you have to fall back to mentally tracing through what's going on. If I really need to understand it, I start segmenting the code into sections and adding comments about what it looks like each section is doing. Then you can do a few iterations in bottom-up style. For example, with branches, start out by commenting what every branch does considered in isolation. Then from those comments (now hopefully more transparent than the original code was), see if you can find what pattern a series of tests is doing in aggregate.
[ Parent
| on HN ]