Re: RE: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /pear DB.php/pear/DB common.phpmysql.php
| From: | Oyvind Moll | Date: | Tue, 05 Dec 2000 09:31: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 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-539@lists.php.net to get a copy of this message | ||
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;
}
Yes, I could (as of 4.0.3pl1, at least) drop the return altogether, but I
prefer to have explicit return values.
(Darn, I hate myself for _liking_ an inconsistency.)
--
Øyvind Møll <oyvindmo@initio.no>
Initio IT-løsninger AS <URL: http://www.initio.no/ >