Joke Collection Website - Joke collection - How to annotate the code?

How to annotate the code?

C/C++/C#

Line comments://The following are comments.

Block comment:/* Here is the comment */

Java language (a computer language, especially for creating websites)

Line comments://The following are comments.

Block comment:/* Here is the comment */

Hypertext markup language

Block comments:

Semi-cast steel Cast Semi-Steel

Block comment:/* Here is the comment */

Java Script language

Line comments://The following are comments.

Block comment:/* Here is the comment */

extensible markup language (XML)

Block comments:

computer programming language

Line comments: # The following are comments.

Block comment:''' Here is the comment'''

SQL Server/Oracle PLSQL

Line comments:-The following are comments.

Block comment:/* Here is the comment */

relational database

Line comments:-The following are comments.

Line comments: # The following are comments.

Block comment:/* Here is the comment */

verb

Line comment:' This is a comment.

assembler language

Line comments:; This is a note.

Actual extraction and reporting language

Line comment: # This is a single line comment.

Block comments:

=pod?

This is a note.

= cut

matlab

Line comment:% This is a comment.

Block comments:%% Below are comments%%

Block comments:% {The following comments are%}

R programming language

Line comments: # The following are comments.

Block comment: if(false){ here is the comment}

Extended data:

About annotations in high-level languages:

1, comments are "tips" or "explanations" of the code instead of documents; Comments are mainly used to explain code complexity; Notes should be accurate, easy to understand (unambiguous) and concise; The effective annotation amount in the program must be above 20%. ?

Note: If the code is clear and can be self-annotated, comments are not needed. Too many details are easy to get bored. Remember not to be so profound that others can't understand it without commenting. ?

2. The purpose of comments: to facilitate the maintenance of the code, explain the functions and methods of the code, facilitate readers to read and prevent unnecessary information duplication. ?

3. It is definitely a good habit to annotate the code. It is best to write comments while writing code.