Re: PHP Standard style of writing your code

From: Date: Sat, 29 Apr 2006 05:38:19 +0000
Subject: Re: PHP Standard style of writing your code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-235056@lists.php.net to get a copy of this message
IMHO, vertical aligned brackets can be messy when nesting relatively-small blocks (and seems to me like a lot of wasted space) A couple of facts of my codding style: - I tend to always use brakets, so I ignore the fact that single lines/actions can be written without brackets, - I try not to let lines grow larger than about 100 cols (cannot be really done with strings and other thingies, and maybe that should remain in the old 80 cols, but it's too litle space), and - I use a 4 space indentation, and that alone suffices for making a block stand clear enough So, in my case, the code would be something like function foo( $x ) {
      // body...
} ··· $a = foo($b); Chris W. Parker wrote:
So no matter what was actually typed, *I* would see: function foo ($x) { //body } but some heretic who doesn't know any better would see: function foo($x) { //body } [···]
Setting aside the fact that you're completely wrong about your preference... ;) What, in your mind, is the advantage to putting the opening brace on the same line as the function call, logic statement, etc.? (Btw, this is a serious question!) [···]
P.S. What, in your mind, is the advantage of replying after quoting the original message and not before? :) -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx

« previous php.general (#235056) next »