I came across this piece by Joel, where he says ”It’s harder to read code than to write it”.
PERFECT. Atleast my programming experience matches with what he says. On the other hand, I do not interpret it as ’so just stop reading code and do something else’. If you have to do real programming, you have to spend time ’understanding’ already written code.
Now, the deeper reasons for why it could be hard to read code could be:
Here I have found my detective utilities (here , here) very handy. It eliminates the futility of reading code as it helps me ’understand’ code relevant to the feature I am working upon as it provides:
With the information provided by detective, I can explain the code in business terms to someone else while pointing to function names. Thats it. I have learnt the lesson the hard way.
So if Joel says ”Its harder to read code than to write it.”, we now have a corallary:
”Never read code without contextual information.”
I am a 3D graphics software engineer.