[PHP-DEV] Coding standards (layout)

2001-07-29 Thread Zeev Suraski

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Coding standards (layout)

2001-07-29 Thread Zeev Suraski

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 KR 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Zeev Suraski [EMAIL PROTECTED]
CTO   co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]