Re: Coding Standards
| From: | Aidan Lister | Date: | Tue, 22 Jun 2004 10:22:32 +0000 |
| Subject: | Re: Coding Standards | ||
| References: | 1 2 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-4539@lists.php.net to get a copy of this message | ||
Although I prefer the first, the last seems to be more widely accepted as
correct. I suggest we go with that.
"Daniel Convissor" <danielc@analysisandsolutions.com> wrote in message
news:20040628143250.GB24671@panix.com...
> 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