News for hackers. Stuff that matters.
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.
Re:Ask HN: How do you "read"/understand/interpret existing c... by mpg33 on Tuesday August 23, 2011 @09:16PM (#2919029)
funny you should say skimming...because thats how i have been looking at code and i think it is my main problem...i try scanning the code over and over but get nowhere with it