Re: Coding standards (layout)
| From: | Zeev Suraski | Date: | Mon, 30 Jul 2001 05:25:10 +0000 |
| Subject: | Re: Coding standards (layout) | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-61420@lists.php.net to get a copy of this message | ||
For those of you who aren't sure where the heck those space-after-comma and the other rules are coming from, that's the K&R coding standard, which is the coding standard for the php4 repository. One other rule that's really not followed is [3]:
[3] Be generous with whitespace and braces. Always prefer:
if (foo) {
bar;
}
to:
if(foo)bar;
Keep one empty line between the variable decleration section and
the statements in a block, as well as between logical statement
groups in a block. Maintain at least one empty line between
two functions, preferably two.
At 20:09 29/07/2001, Zeev Suraski wrote:
Guys, Please follow the coding standards as they appear in the CODING_STANDARDS with code you commit to the PHP repository. Stuff I noticed while going over large portions of code in the last few days: - open-curly-braces should not appear on the same line as a function declaration, but on the following line - commas (e.g. in function calls or declarations, or macro calls) should be followed by a space. I.e., foo(a, b, c), never foo(a,b,c). Going over code which has many different layouts is a real pain. The code in the php4 repository at least should be consistent. Thanks, Zeev -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net-- Zeev Suraski <zeev@zend.com> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/