Programmer's Manual

   I think everyone knows the code you write. You can’t just let yourself understand that you can understand your own code. It’s not a skill to let everyone see the code you write, and many programs have to interact with others. Develop together, so everyone has to have a unified code specification, just like the Chinese people unify Mandarin. The code is like this. The programming specification during development work ensures the consistency of the code, which is convenient for communication and maintenance. Let me tell you about the code. The rules in it.

  1.
   For code files (such as functions, scripts) created by yourself, generally write the following comment at the beginning of the file:
   /************************* ************************
   author:
   group:
   Description:
   creation date:
   version:
   ************** ********************************/

  2. Standard comments
   Add comments in the front line of modules, classes, properties, and methods to prompt the user
   to use the method declaration as an example when calling :
   ///<summary>
   ///depiction: <description of the method>
   // /</summary>
   ///<paramname="<parameter name>"><parameter description></param>
   ///<returns>
   ///<The description of the method return value, the description must clearly state the return What is the meaning of the value>
   ///</returns>
   If the module only modifies a small amount of code, the following comment must be added for each modification:
   ///modified by:
   ///modified date: <YYYY-MM-DD >
   ///Backup:
   /*Original code content*/
   Comment out the original code content, and then add the new code using the following comment:
   ///Added by:
   ///Added date: <YYYY-MM-DD>
   Code content
   / //end:

3. Inter-
   code comments Inter- code comments are divided into single-line comments and multi-line comments:
   Single-line comments:
   //<Single-line comments>
   Multi-line comments:
   /*Multi-line comments 1
   Multi-line comments 2
   Multi-line comments 3*/

Why write comments?

  Writing comments is convenient for later maintenance. The program written by yourself may be taken over by others. If there is no comment, the problem should be output. It is not possible to accurately find the line of code that has the problem, and it is not easy for others to understand the code. If there are comments, it will be different, and people who are convenient to maintain and watch the code will have a clear idea.

Guess you like

Origin blog.csdn.net/yanghezheng/article/details/103840125