Advertisment

Tips for reading other person's code

author-image
CIOL Bureau
Updated On
New Update

How many times have you read through and tried to make sense of code written by other people? Humongous task, I must say, more so if you do not have access to supporting documentation and the person who coded it. And this in spite of the all the 'gyan' that each one of us must have got during the first few lessons of our training.

Advertisment

Joel Spolsky shares on his blog, tips sent to him by his friend Seth Gordon, on how to read code written by a third-party. Check it out…

1. Work in pairs, thinking out loud to one another.

 2. Argue. If your partner says "this means X", and you either don't understand why or you have another opinion, demand an explanation.

3. Sometimes, when dealing with a chunk of text, it's easier to figure out the middle *after* you understand what's on both ends. Therefore, if a fragment of text has you stumped, try skipping over it and seeing if you can come back to it later. (But you still have to come back to it eventually.)

4. Read the text both "inside" and "outside". An inside reading translates the text into English (or whatever your native language is) phrase-by-phrase; an outside reading translates a larger chunk into an idiomatic paragraph. If you only read inside, you can miss the forest for the trees; if you only read outside, you can fool yourself by making broad guesses and not verifying them with details.

tech-news