another religious issue, was [PHP] Require() vs Include()
| From: | Nebbe, Joelle | Date: | Tue, 14 Nov 2000 09:47:51 +0000 |
| Subject: | another religious issue, was [PHP] Require() vs Include() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25167@lists.php.net to get a copy of this message | ||
> if( !$db_oracle_inc_def )
> include "$DOCUMENT_ROOT/inc/db_oracle.inc";
>
> as you can see there are no statement block (no brackets)
I always put brackets in even when there's only one statement cause
it makes it much easier to read/maintain. But so many people seem
not to use brackets that I wonder: is there a disadvantage to using
brackets (apart from a few keypresses more)?
On a similar note, I've read somewhere that use of the "condensed" if/else
assignment ( ? : ) construct was recommended over the "normal" if/else when
there's only one assignment in the test. Again, that makes life less easy
for
whoever comes and needs to extend your code, especially if the expressions
tested and assigned are non trivial, so I only use it when it's really
obvious.
Yet I wonder, does it makes a performance difference?
Joelle Nebbe
_______________________________________________________________________
Any opinions expressed in the email are those of the individual and not
necessarily the company. This email and any files transmitted with it
are confidential and solely for the use of the intended recipient.
If you are not the intended recipient or the person responsible for
delivering to the intended recipient, be advised that you have received
this email in error and that any use is strictly prohibited.
If you have received this email in error please notify the IT manager
by telephone on 0113 243 2701
_______________________________________________________________________