coding standards - control structures
| From: | ed | Date: | Fri, 27 Sep 2002 20:16:23 +0000 |
| Subject: | coding standards - control structures | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117886@lists.php.net to get a copy of this message | ||
Hey all. I've read the pear coding standards.
I assume that if php has any official coding standards
then the pear standards would be them, correct?
Anyways, the pear docs on coding standards show
examples of using controls structures like
the following:
if ( !$var ) {
do_something();
}
else {
do_something_else();
}
-------
But I really don't like putting the opening brace
on the same line as the control statement.
I really prefer doing this:
if ( $var )
{ do_something();
}
or
if( $var )
{ do_something();
}
else
{ do_something_else();
}
-------
Putting the opening brace one line down on the same
column that the control statement starts on seems to
give me a much better visual cue, especially when
dealing with nested control statements.
Is doing it my preferred way acceptable?
Will my code be looked down on?
thanks,
--ed
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com