What information should be entered in the comments at the beginning of the source code file?

What information do you think should be placed in the comment at the beginning of the source code file?

All I could think of was the name of the author and, possibly, the date the file was created (although I'm not sure if there is any useful value for this information).

[EDIT] To clarify, I do not mean comments in front of the class, but in the first lines of the file, before including operators and what else. how

/**
 * Author:    Name
 * Created:   11.05.2009
 * 
 * (c) Copyright by Blub Corp.
 **/
+5
source share
5 answers

What to put in the file header:

  • Library / component whose source code is part
  • Copyright Information
  • A brief and meaningful description of the class (s) in the source file

:

  • , , . , .

  • () . ?

    • , , . , , .
    • " wiki" ; -)
    • , , , ?
  • . , . : , , ?

+21
  • Copyright
  • ()
  • ( )

: ()

+2

/, , , /, , .

+1

File Encoding! (UTF-8)

# -*- encoding: utf-8 -*-

Especially if you plan to share your code with someone else in some other part of the world at some point.

0
source

with all of the above, I also placed detailed information about the purpose of the code in this file, as well as something that you think may be useful in debugging and understanding the functionality. This assistance is in service and support.

0
source

All Articles