Flippant code comments
Posted Nov 4, 2011 21:53 UTC (Fri) by
giraffedata (subscriber, #1954)
In reply to:
Flippant code comments by njs
Parent article:
Quote of the week
Code fluency is a skill you can acquire.
I'm pretty sure I can't. I've read millions of lines of C code written by hundreds of coders. I know the syntax like the back of my hand and I know all the paradigms. I still read English descriptions of computation about 10 times faster than the C implementation. When I have to understand uncommented C code, I usually decipher it little by little and write down my findings in English and then use that document for all my work. For example, I have 1300 lines of English about what various parts of Mplayer do. It saves me hours every few years when I have to fix a bug or add a feature. If I didn't want to preserve the ability to merge Mplayer updates from others, I'd just put that text into the source files as comments.
And that was my point. Brains work differently. Some people criticize others as lazy for not commenting code, but it may be that the others just don't benefit from comments.
(
Log in to post comments)