Re: PHP Standard style of writing your code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux