Re: coding standards - control structures

From: Date: Fri, 27 Sep 2002 20:35:07 +0000
Subject: Re: coding standards - control structures
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117890@lists.php.net to get a copy of this message
I believe the standards are for coding PEAR modules so all code is presented in the same style. It really has no influence on the language or community at large. I say code the way you feel most comfortable with and damb to anyone who complains. :) -Kevin ----- Original Message ----- From: "ed" <coo_t2@yahoo.com> To: <php-general@lists.php.net> Sent: Friday, September 27, 2002 2:16 PM Subject: [PHP] coding standards - control structures > 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 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#117890) next »