4.2 Single-line comment
Short annotations can be displayed in a single line and have the same indentation level as the code behind them. If a comment cannot be written in one line, it should take a block comment. There should be a blank line before a single-line comment. Here is an example of a single line comment in the code:
if (condition) {
/* The following code runs the condition */
...
}
4.3 Tail end Comment
Very short annotations can be on the same line as the code they are describing, but there should be enough whitespace to separate the code and comments. If more than one short note appears in a large segment of code, they should have the same indentation.
The following is an example of an end note in a code:
if ($a = = 2) {
return TRUE; /* Description of the single condition */
} else {
return IsPrime ($a); /* The rest of the conditions */
}
http://www.bkjia.com/PHPjc/532598.html www.bkjia.com true http://www.bkjia.com/PHPjc/532598.html techarticle 4.2 Single-line comment a short comment can be displayed in one line and has the same indentation level as the code behind it. If a comment cannot be written in one line, it should take a block comment. Single-line note ...