You are here: Re: do professional PHP programmers use error checking in their code? « PHP Programming Language « IT news, forums, messages
Re: do professional PHP programmers use error checking in their code?

Posted by B.r.K.o.N.j.A on 09/03/06 16:22

> My own feeling, obviously, is that it is better to error check
> everything, and to write extensive comments everywhere. I've taken over
> PHP projects, started by other programmers, that had no error checking
> and no comments, and such projects are always a big pain in the neck. I
> lose time playing Sherlock Holmes, trying to track down where a
> function's parameter first originates and why it's in use. I'd rather
> have a comment on it, and error message for when the wrong thing is
> passed in. Obviously this slows development. Is there any concensus
> among developers about what is the best approach? I think whatever is
> cheapest for the client should be considered the best approach, but it
> seems to me cheapest-in-the-short-term is quite different from
> cheapest-in-the-long-term.

In my personal opinion and experience, if I were a project manager and
I've heard the words "php will handle errors for you, why bother?" from
any of the programmers I work with, I would fire that person on spot.
It's HORRIBLE practice and it leads to lots of crap php code out there
and also the "not serious programmer" stereotype about php developers
(enforced mostly by java and c# folks - who (you've guessed it :) handle
their errors and exceptions). So my advice is handle all the errors, USE
the exceptions as much as you can, log errors for after analysis but
don't reinvent the wheel (e.g. don't reinvent the text of DB error
messages, just handle them and give them context).

--

B.r.K.o.N.j.A = Bionic Robotic Knight Optimized for Nocturnal Judo and
Assasination

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация