4.2 Single-line comments
Short comments can appear on one line and have the same indentation level as the following code. If a comment cannot be written in one line, use a block comment. Single-line comments should be preceded by a blank line. Here is an example of a single line comment in code:
if (condition) {
/* Conditions for the following code to run */
...
}
4.3 End comments
Very short comments can be on the same line as the code they describe, but there should be enough white space to separate the code and comments. If multiple short comments appear in a large block of code, they should have the same indentation.
The following is an example of a trailing comment in code:
if ($a == 2) {
return TRUE; /* Explanation of a single condition*/
} else {
return isPrime($a); /* The rest Conditions*/
}