Re: should I be looking to eliminate all notices?
| From: | Robert Cummings | Date: | Mon, 23 Apr 2007 20:00:49 +0000 |
| Subject: | Re: should I be looking to eliminate all notices? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-253541@lists.php.net to get a copy of this message | ||
On Mon, 2007-04-23 at 15:56 -0400, Justin Frim wrote:
> Edward Vermillion wrote:
>
> >
> > On Apr 21, 2007, at 6:35 PM, Justin Frim wrote:
> >
> >> I've always gone by the rule that if you're making software that
> >> other people will see or use, make it clean.
> >> Sometimes I'll "cheat" and stick a @ symbol in front of a line to
> >> shut up errors and warnings for that particular line, but usually I
> >> only do that for speed optimization. (ie. if it's in a short loop
> >> that cycles many times).
> >
> >
> > Your not saving any cycles. The error handler still gets called, the
> > error just doesn't get shown.
> >
> > And '@' is just another way of ignoring an error in your program. Not
> > really a good idea if you want to right good code.
> >
> > Ed
>
> Surely that's faster than calling isset(), declaring another variable,
> and executing another if() statement though, no?
It's probably faster if no notice is generated. It's almost certainly
slower if a notice *is* generated. It's definitely bad practice and a
lazy way to hide poor implementation.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'