C # differences between // annotation and // Annotation,
/// Will be compiled,
// No
So the use of // will slow down the compilation speed (but will not affect the execution speed)
/// SMART awareness will be provided when other people call your code
C # Coding often involves code comments. Common comments include:
1) single line comment. Format: // Comments
2) multi-line comment. Format:/* Comments ...*/
C # introduces a new XML comment, that is, we start a new line before a function, input //,. net will automatically add XML format annotations. Here we will sort out the available XML annotations.
XML annotations are divided into Primary Tags and Secondary Tags. The former can exist independently, and the latter must be included in the first-level annotations.
I level 1 comment
1. <remarks> describes the type. The function is similar to <summary>. It is said that <remarks> is recommended;
2. <summary> comment out classes, methods, attributes, or fields of the common type;
3. <value> is mainly used for Attribute comments, indicating the meaning of the attribute system. It can be used with <summary>;
4. <param> describes the parameters of a method. Format: <param name = "param_name"> value </param>;
5. <returns> defines the return value of a method. After a method is input, the <summary>, <param> list, and <returns> are automatically added;
6. <exception> define an exception that may be thrown. Format: <exception cref = "IDNotFoundException">;
7. <example> describes how to use a method, attribute, or field;
8. <permission> access permission for methods involved;
9. <seealso> is used for reference to a certain other stuff :). You can also set attributes through cref;
10. <include> used to indicate external XML annotations;
II level 2 comment
1. <c> or <code> is mainly used to add code segments;
2. The <para> function is similar to the <p> identifier in HTML, that is, segmentation;
3. <pararef> is used to reference a parameter;
4. The <see> function is similar to <seealso>. Other methods can be indicated;
5. <list> used to generate a list;
You can also customize XML labels.