how do you read code?
gills: I don't find 'main' and friends to be very meaningful), but sometimes it's ok to start there, if you don't have anything in particular to find.  And structure is usually an artifact of behavior, so I almost always start with trying to understand the behavior.I like to first familiarize myself with the overall program flow.  With an IDE I can usually do this with 'called from' or similar views;  if I can run the code, throwing stack traces paints a nice picture of potentially-interesting control paths, taking note of interesting details along the way.Other than that, there's usually something I'm looking for when I dive into a piece of code.  So I find that function or something that looks like the right area and start poking around the places it goes and the places it comes from, see what parameters are moving around, what side effects are taking place, etc.I usually try to build a mental model of what I would build if I were trying to solve the same problem.  It's usually not spot-on, but just doing a little thinking ahead of time helps me navigate the program more easily, predict what is going to happen, and be aware of recognizable handholds.I try to keep an eye out open for abstractions and patterns so I can keep a sightly more terse mental model and hopefully fit more of the program in my head.  If it's a really big chunk of code I'll keep pencil and paper handy and map out the program's design as a I go.Oh yeah -- keep docs handy.  Every now and then they actually help.