2019/11/16 C language specification writing specifications 2. Comment

1. The effective amount of Notes must be at least 20% must be accurate and understandable language concise comments
2. The header file should be comments, which must be listed: Release Notes, version number, creation date, author, content, functionality, modify logs.
3. Note the function of the head shall be listed: object / function, input parameters, output parameters of the function, the return value, call relationship (function table) and the like.
4. While writing code annotation edge, code changes, modifications corresponding annotation, to ensure consistency of comments and code. Comment deleted useless
5. Notes content to be accurate and clear, not ambiguous
6. Do not use comments only you know how to look abbreviation
7. Note single line of code to be placed over a single line of code or right, to be spaced on a blank line when the statement is placed on top of
8. variables, constants, macros, comments should be placed above or to the right
9. Note that the data structure on top of the comment, which is placed right members
10. Global variables have detailed notes, including their function, range of values, function calls, etc. (anyway, I do not label myself as much)
11. Do not insert comments in the code or expression
12. Note that the format code comments, do not mess, affect the perception of the code. Note indent and preferably the same codes as described, allows the typesetting program neat, easy comprehension. Unified format: / * ...... ...... * /
13. Notes useful information, not information useless comments
14. A variable definition statements and branches (conditional branch, loop, etc.) must be written annotations
The best comment about 15.switch case statement
16. The Chinese language is recommended, unless you are very English, very clear expression of
 
 
   ------ Reference "C language routines wonderful 200 cases."

Guess you like

Origin www.cnblogs.com/epll/p/11874141.html