8

I realize that the "header comment" format varies from programmer to programmer, but what would be an example of a "good" header comment?

  • Is this question about only formatting, or about style and content? – Macneil Mar 30 '11 at 22:30
  • @Macneil Depends on what they mean. For now, I'll play safe and say "both". :) – Mateen Ulhaq Mar 30 '11 at 22:33
4

Regarding formatting style, consistency is most important to strive for. Make sure every class definition comment looks like every other one, every method comment looks like every other one, etc.

So, if you're modifying existing code, make sure you follow their formatting style. The comments (and, to an extent, code) should look like only one person has worked on the file. If you're starting a new project, pick one style format and stick with it.

Places to start looking:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.