Was just wondering, how do you guys go about to wrapping your head around massive code?
I have this little queue program in my book, it has 4 classes with an interface, and the algorithms are just so interlocked I find my self lost while reading it!
I had to go through similar code before, took me about 3 days to really comprehend it ! am I taking too much time?
What usually helps me is a mixture of pen and paper, and walking through the code with a debugger. The pen and paper part can be whatever helps you get a handle on it. Sometimes, I'll draw a simple box diagram with the different parts to help me see at a glance what talks to what and how they are related. Sometimes, I'll just note down what I interpret the algorithm to be and I'll work through it with some sample numbers or data structures (such as lists).
The debugger is especially helpful for this last part as it makes it very easy to see if what you think is happening actually is happening. If you aren't familiar with all the features of the debugger in your favourite dev environment, I highly recommend taking the time to learn how to use it. It's one of your best friends for really understanding what's going on inside your program. (Detailed logging can also provide a window into the application, but in the code I regularly work with logging is.... sub-optimal to say the least ).
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad: