Re: Re: PEAR Coding Standards
| From: | Mirco 'meebey' Bauer | Date: | Tue, 04 May 2004 09:06:57 +0000 |
| Subject: | Re: Re: PEAR Coding Standards | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28760@lists.php.net to get a copy of this message | ||
On Tue, 2004-05-04 at 02:07, Alan Knowles wrote:
> @ has considerable uses - and should have some guidelines:
> eg.
> ------ INCLUDING AND REQURING ----
> @ should not generally be used infront of include/require, as it
> a) prevents user readable errors
> b) can hide fatal parse errors..
>
> @include_once 'somefile.php';
> .. if, like PEAR DB, people when first installing, often mess up the
> include path, and get
> 'DB_Failed' ....
> It would save everybody alot of time and effort if it was
> include_once 'somefile.php';
> and emited an error
> could not find somefile.php in include_path ........
>
> If failure to include the path is 'acceptable' - then the method call
> itself can be silenced. (however this tends to be very rare..)
>
> ------ GENERAL USAGE ------
> there are times when checking variables where although it is minutely
> slower, it does aid readibility.
>
> if (@$options['dosomething'] == true) {
> is significantly clearer than
> if (isset($options['dosomething']) && ($options['dosomething'] ==
> true))
> { .....
> ----------------------------------
> @ is part of the language, and in some respects is just a short form of
> catch/try/throw.
full ACK
--
Mirco 'meebey' Bauer
PGP-Key:
http://search.keyserver.net:11371/pks/lookup?op=get&search=0x5051C9B9
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d s-: a--- C++ UL++>++++ P L++$>+++$ E W+++$ N o? K- w++>! O- M- V? PS
PE+ Y- PGP>++ t 5+ X++ R tv+ b+ DI? D+ G>++ e h! r>++ y?
------END GEEK CODE BLOCK------
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc