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