4.2 Single line comment short comments can be displayed in one line and have the same indentation level as the subsequent code. If a comment cannot be written in a row, block comment should be used. There should be a blank line before a single line comment. The following is an example of a single line comment in the code: if (condition) {/* The following code SyntaxHighlighter. all ();
4.2 Single line comment
A short comment can be displayed in a row and has the same indentation level as the subsequent code. If a comment cannot be written in a row, block comment should be used. There should be a blank line before a single line comment. The following is an example of a single line comment in the code:
If (condition ){
/* Conditions for running the following code */
...
}
4.3 End comments
Very short comments can be in the same line as the code they want to describe, but there should be enough white space to separate the code and comments. If multiple short comments appear in a large code segment, they should have the same indentation.
The following is an example of the end comment in the code:
If ($ a = 2 ){
Return TRUE;/* description of a single condition */
} Else {
Return isPrime ($ a);/* Other conditions */
}