Re: RE: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /pear DB.php/pear/DB common.phpmysql.php

From: Date: Tue, 05 Dec 2000 11:42:39 +0000
Subject: Re: RE: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /pear DB.php/pear/DB common.phpmysql.php
References: 1 2 3 4 5 6  Groups: php.pear 
Request: Send a blank email to php-pear+get-547@lists.php.net to get a copy of this message
Hello Oyvind, On Tue, Dec 05, 2000 at 10:31 +0100, Oyvind Moll wrote: > > On Tue, Dec 05, 2000 at 08:15:42AM +0100, Stig S. Bakken wrote: > | Chuck Hagenbuch wrote: > | > > | > In the case of an if with no else clauses, and only a 1 line action, > | > the curly braces may be omitted: > | > > | > if (condition) action; > | > > | > if (condition) > | > action; > | > | I disagree with this one. I find always using braces helpful because it > | makes it easier to add a new line, it makes debugging easier and it is > | more consistent. > > I agree with Stig here. However, I omit braces in a different case: > > function foo($foo) > { > if (try(something)) { > do; > some; > more; > stuff; > } else return false; > } You could save some indentation space (not the last thing to care about when it comes to parsing source on each server request) writing like this: function foo($foo) { if (!try(something)) { return false; } do; some; more; stuff; } P.S. Does any convention exists on names of constants, particularly on 'true', 'false' and 'null'? Should we write them in capital or small letters consistently? -- Stay tuned, MhZ mailto:mookid@sigent.ru ----------- You are not a fool just because you have done something foolish -- only if the folly of it escapes you.

« previous php.pear (#547) next »