Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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
up vote 3 down vote accepted

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:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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