Re: PHP Standard style of writing your code

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

 



On Sat, 2006-04-29 at 03:17, Richard Lynch wrote:

I'll also respond to another poster:

I personally have no less/more ease in aligning } with a logic
statement or with another {, *IF* the code is indented properly.

In other words, the vertical alignment is more a function of the
indentation, to me, then of a specific character I have to pick out.

If the code isn't indented properly, well, then, the alignment of
whatever you do vertically doesn't matter much, eh?

I prefer the opening brace at the end of the line as well. I rather see as much of the code as possible. Wasting one line for an openning brace, and not only function declarations but any opening brace, is a waste of screen space. My eyes are no longer good enough to have microscopic screen resolutions so within the resolution I use plus all the toolboxes, I still want to be able to see a good chunk of the code.

For me, the visual consequence of an opening brace is the indentation of the line following it. The brace by itself is just what tells the compiler to start the statement block. The visual clue, for me, is the indentation, something I am very strict about. The compiler cannot read indentations. So, since the brace is for the benefit of the compiler, not mine, I don't devote a whole line to it. Braces for the compiler, indentation for me.

And it is not that I don't like to waste space in general, I am generous with my lines before the function declaration or any other place where I feel it deserves it for clarity. In C I put one or more blank lines in between the local variable declaration and the first executable, that is a space that is worth for clarity sake. I would also put spaces before a #ifdef or after a #endif, those are spaces that say something to me.

A brace on its own line doesn't make sense to me.

Satyam

Satyam

--
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