« vi survival guide | Vim tips: Using viewports »
Learn how to comment
This wikipedia tells about different commenting styles and how they can be helpful while programming.
http://en.wikipedia.org/wiki/Comment#Summary
Comments could summarise code or explain the programmer’s intent. This is called the why rather than how approach. The two are often close, but not always. According to this school of thought, restating the code in plain English may be a waste of time; the need to explain the code may be a sign that it is too complex and should be rewritten.
- “Don’t document bad code – rewrite it” (The Elements of Programming Style, Kernighan & Plauger).
- “Good comments don’t repeat the code or explain it. They clarify its intent. Comments should explain, at a higher level of abstraction than the code, what you’re trying to do.” (Code Complete, McConnell)
- Happy Coding !!
Link from : Kshitij’s Blog
May 28, 2006 | Filed Under Uncategorized
Tagged:
Tagged:
Comments
Leave a Reply
Add to del.icio.us Network
Google Reader Shared Items
Twitter Feed
Flickr Photos