Tuesday, November 22, 2005

Commenting Code

  1. Document the purpose of the code
  2. Document the why rather than the how
  3. If you need to violate good programming style, explain why in the code.
  4. Comment before writing code
  5. Use solid-character comment lines only for major comments
  6. Avoid creating comment boxes
  7. Give each procedure a comment header
    Purpose
    Accepts
    Returns
  8. Document code processes by using inline comments

No comments: