Re: Coding Standards: Syntax and identation

From: Date: Sat, 02 Dec 2000 23:01:39 +0000
Subject: Re: Coding Standards: Syntax and identation
References: 1 2  Groups: php.pear 
Request: Send a blank email to php-pear+get-473@lists.php.net to get a copy of this message
Chuck Hagenbuch wrote: > > Quoting Ulf Wendel <ulf.wendel@phpdoc.de>: > > > does PEAR overtake the PHP Coding Standards when it comes to syntax and > > identation? > > I'd guess that the php coding standards, being meant for C, aren't going to > apply to PEAR most of the time... That's true, but it's a good starting point. And wasn't PEAR meant to be a repository for PHP scripts and PHP extensiions written in C as it started? > > That means I should use this style, right? > > > > /* one line comment */ > > > > /* > > multi > > line > > comment > > */ > > I prefer: > > /* multi > * line > * comment > */ > > But everyone seems to vary, the the PHPDoc-style comments are slightly > different, as well... I don't really care on the style of comments. Other things are more important. I was just looking for some opinions. > > Is that a must if it comes to curly braces? I preferr the BSD style > > instead of the K&R one. This is K&R: > > I'd say that as long as every class is consistent in terms of which style it > uses (ie, every file), we don't really need to mandate something like this. I don't think so. Do you like this way, I don't...? if ($bar == 0) { if ($foo = 0) { print $foo }} > > I used tabs with a width of 2 spaces in PHPDoc, was that a good idea? > > *shrug* Like with indenting style, I don't think it's going to be important (or > eventually, possible) to get this consistent across every single file... I use 4 > spaces; tab set to 4 spaces is also fine by me. Well, I just reformatted 500 lines in the PHPDoc source. One of the last commits someone made doubled all linebreaks in two files. One file was reformatted, because all tabs have been replaced with 4 spaces. We need some rules to avoid such situations. In my private projects I use tabs, in my company I have to use two spaces, what's the suggested way for PEAR? Ulf

« previous php.pear (#473) next »