. NET annotation types, single-line comments, multiline comments, document comments ...

Source: Internet
Author: User

Comments are not for the compiler to see, but for programmers. is a way of communicating between programmers. Good programmers must have sound comments.

. NET annotation type.

1. Single-line comment//

A. When the lines of code are shorter, comments can be placed behind the code.

B. When the line of code is longer, the comment must be placed on top of the comment code, not below.

C. Shortcut keys: Select the code you want to annotate,

Note: Ctrl k +ctrl C

Uncomment: Ctrl k + CTRL U

2. Multiline comment/* */

A. Multi-line annotations cannot be nested.

3. Documentation Comments//

A. Shortcut keys enter three consecutive slashes ("///") on the top of the method header, class, enumeration, interface

VS will automatically add a document comment to us.

B. When we reference an object of a class that has a document comment, point to a method, or hover over it, to show the contents of the document's comments.


Description of the function


<param name= "parameter name" > Description of Parameters </param>

<return> return Value Description </return>


_ooooo_//o8888888o//88 ". "88//(| -_- |)   o\ =/o//____/'---' \____//. ' \\| |//'.///\\| | | : ||| // //                     / _||||| -:- ||||| - //                       | | \\\ - /// | |//                     | \_| ' \---/' | |//\-\__ '-' ___/-. ///                   ___`. . '/--.--\ '. . __//                ."" ' < '. ___\_<|>_/___. ' > ' ".//| | : `- \`.; `\ _ /`;. `/ - ` : | |//                 \ \ `-.         \_ __\/__ _/.-'////\ ====== '-.____ '-.___\_____/___.-' ____.-' ======//' =---= '////                  .....//.....//.....//......//Buddha-Town Building Bug----------------- Office Building, writing Room programmer;//program staff write procedures, and take the program for drinks. Sober only sit on the internet, drunkAlso to the net sleep,//drunk Awake day after day, online network next year. I hope the old computer, do not want to bow to the boss before;//Mercedes-Benz BMW is interesting, bus self-programmers. Others laugh at me crazy, I laugh at my life is too cheap,//Don't see the street pretty sister, which is the programmer?

. NET annotation types, single-line comments, multiline comments, document comments ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.