VS Write Code Four comments (C #), making programming easy

Source: Internet
Author: User

As the development progresses, as developers grow, with the developer's various coding styles, without annotations, it is difficult for different coders to communicate and communicate. The note is like the preface in a book, this book has no help to oneself, read Preface to know, this piece of code to oneself have no help, read the comment to know! The note is like a light in the middle of the night, the beacon guides our way, comments help us understand the code! The proper annotation lets the programmer like bathe in the spring breeze, orchids! Reluctantly used a parallelism, not for anything else, to reflect the importance of annotations. First Comment: class header comment

"Each time a new class is created, a comment is automatically written, including the author, date version, and function of the class" implementation process:
    • Open the installation folder for VS, enter Class.cs in the search box, as shown in

    • Open each class.cs with Notepad, and add the following to save the exit

/********************************************************************************* * auth:spener** Date: $time $** desc: Not yet written description * * Ver.: V1.0.0*********************************************************************************/
    • After each class.cs is changed and saved, the class header comment is automatically generated when you open the VS new C # class.
Second Note: class comments

"When calling a function, there is a corresponding function hint." 】

Implementation process: Very simple input in front of the method: ///Three slashes will be OK. Third Kind of comment: code snippet Comment

Implementation process:
#region 增加新闻//增加新闻函数#endregion

"Then it will comment on this code, right-click – outlining – collapse definition, it will show the above Chinese hints, with a lot of code is very useful. 】

Note Fourth: General comments

This annotation means that if a sentence does not understand, add a comment, it is the most we use a note

Talk about the pursuit of "irrelevant." 】

The pursuit, is the millennium unchanged most emotion, hundred generations of the dream, is refreshing, leaving a pastoral landscape, is a person, a family, a nation, a country, the lofty ideals of struggle. Because of the pursuit, there is an old and beautiful legend, with the pursuit, there is a stretch of boundless, with the steel wall of flesh and blood, with the pursuit of a Buddha standing in between heaven and earth, never bow the statue.

VS Write Code Four comments (C #), making programming easy

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.