Travis Low wrote:
I have to say I like everything about the PEAR coding standards except for the K&R bracing style. I much prefer:
if( foo ) { blah; }
to
if( foo ) { blah; }
The latter form (K&R) conserves vertical space, but I find it a lot harder to follow. Harder to move blocks of code around too. I'm sure plenty of people disagree, so of course this is IMHO.
And I'm one of them. :-) I like the K&R version because it saves verticaly space and most editors can't really handle correct tabbing when you put it after. IMHO it's just not necessary as ALL blocks should have braces, even those that are one-line. If you always use the braces, you can looks for indenting as the open of the block and the end-brace (and un-indenting) as the close of the block.
cheers,
Travis
Michael Nolan wrote:
charles kline wrote:
Hi all,
I was having a conversation with a friend and talking about coding standards in the open source community (focusing on PHP). I seem to remember there being a document out there that sort of laid it out pretty well.
Anyone know where I might find a copy?
PEAR has a page in their documentation about coding standards:
http://pear.php.net/manual/en/standards.php
HTH,
Mike
-- paperCrane <Justin Patrin>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php