views:

273

answers:

7

I am on a large project, and have not really made any comment 'headers' in my program yet. I just started using SVN for the project the other day. I want to add the SVN tag $id$, but have not decided on any standard commenting.

So, my question to everyone here, is how does your initial comment block look in all your programs?

i.e:

/***************************************
* myProgram.c 
* revision: $id$
***************************************/
+2  A: 

I don't use one. I don't need one.

Dave Van den Eynde
Neither do I. 15 chars.
Ben Schwehn
Me neither. Although one could argue embedding SCM revision history in the header is convenient, in practice it just ends up being a giant mess that ends up being removed.
Matt Rogish
Looking for samples.
Mike Curry
@Mike what sort of samples do you need?
Dave Van den Eynde
Just a sample block, trying to decide what to go for. Makis posted a sample of his.
Mike Curry
A: 

Company boilerplate copyright + file author/owner and a small purpose section when relevant (eg: when the file contains a collection of small related classes with headers of their own)

Kena
How do you add author when multiple people work on the same document?
a_m0d
Looking for samples
Mike Curry
Only the main code owner is listed. Other contributors will be part of the source control history.
Kena
A: 

If I'm coding some open-source program I usually add a BSD license, otherwise there's no standard header comment.

Ionuț G. Stan
+1  A: 

It depends, but I don't like if they are too fancy. Something like this is enough for me:

/*
 * file.c
 *
 * Description:
 *
 * History:
 *
 * 
 */

Anything more complex is just annoying.

Makis
+2  A: 

I personally use the same comments as the javadoc ones

/**
 * Your comment here 
 */
Sylvain
A: 

Any initial comment block is a wast of space if you have a version tracking software.

eisberg
A version tracking software can't guess for you what a method is doing.
Sylvain
@Sylvain: an initial codeblock shouldn't document a method either.
Dave Van den Eynde
Oh yeah that's right, forgot we were talking about an initial comment block.
Sylvain