Re: Re: PHP Coding Standards
| From: | Justin Patrin | Date: | Tue, 01 Jun 2004 17:00:14 +0000 |
| Subject: | Re: Re: PHP Coding Standards | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187368@lists.php.net to get a copy of this message | ||
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 ) {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.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.
cheers, Travis Michael Nolan wrote:-- paperCrane <Justin Patrin>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