Re: Coding Standards
| From: | Daniel Convissor | Date: | Mon, 28 Jun 2004 14:32:50 +0000 |
| Subject: | Re: Coding Standards | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-4530@lists.php.net to get a copy of this message | ||
On Sun, Jun 27, 2004 at 10:47:51PM +1000, Aidan Lister wrote:
> $foo = (bool)$foo;
> $foo = ( bool ) $foo;
> $foo = (bool) $foo;
So, which format are you choosing? It seems to me the vast majority of
code already in the repository, and elsewhere, uses the first format, so
it seems best to make that the standard.
> define ('CAT_PACK_BASE', basename(__FILE__));
> require_once CAT_PACK_BASE . 'Driver/mysql.php';
Yuck. Defining constants is expensive. Plus it obfuscates what's being
included.
> The page on using include/require needs to be explained better. Require
> should be used in all cases unless the script will run if the include fails
> (ie optional include).
The page seems clear to me. Perhaps you can email the list with the full
text you are thinking of in order to get some feedback?
I'd like to see the CS standardize the format of calling includes to be:
require_once 'filename';
rather than
require_once('filename');
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409