Thursday, August 04, 2005

Quote of the day

"In a perfect world, reading code would be like reading a book. Unfortunately, code is written for computers to execute, not for humans to read. You can’t just read code from start to finish—they’re like those choose-your-own-ending books, forcing you to go all over the place to figure out how not to kill your main character. "

From Successful Strategies for Commenting Code - By Ryan Campbell

The quote is great, but I disagree with some of the statements in the article. I'm more of the idea that code comments should explain why you are doing something, not how. Anyway, as with any imperative guidelines, it is more important the spirit of the law, than the law itself.

In spirit, I think the idea of code comments is to make code more understandable for other people or for a future version of yourself.

No comments:

Post a Comment