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 Jerry Stuckle on 09/03/06 00:21

lawrence k wrote:
> Jerry Stuckle wrote:
>
>>lawrence k wrote:
>>
>>>I've made it habit to check all returns in my code, and usually, on
>>>most projects, I'll have an error function that reports error messages
>>>to some central location. I recently worked on a project where someone
>>>suggested to me I was spending too much time writing error messages,
>>>and that I was therefore missing the benefit of using a scripting
>>>language. The idea, apparently, is that the PHP interpreter writes all
>>>the error messages that are needed, and that I shouldn't write such
>>>code myself. I was given the impression that if I needed extensive
>>>error checking, or strict typing, then I should use a real language,
>>>like Java, but if I'm going to use a scripting language like PHP or
>>>Ruby, then I should leave errors to the interpreter, since the whole
>>>point of using scripting languages is speed of development. Has anyone
>>>else heard this argument, and do you agree with it? I'm wondering how
>>>other PHP programmers handle error messages. Check everything or leave
>>>it to the PHP interpreter to tell you when there is an error?
>>>
>>
>>Obviously either someone who was entirely clueless or a very sloppy
>>programmer. In either case there is no way I would want to work with
>>anyone with that attitude.
>
>
> Actually the fellow (whom I took the project over from) is well
> regarded in the town I live. He is mostly a C programmer. He's
> apparently done quite a few projects (in C) that were quite successful.
> Myself and a co-worker wondered if his PHP work was merely an
> expression of haste, or design. From conversation, I was given the
> sense the answer was "design". But I lost time figuring out his code,
> and I feel that some comments would have done a lot to speed my
> comprehension. I write error checks to make life easier for the next
> programmer.
>

Yep, I've had "hot shots" like that on teams before. Quite frankly, I
haven't been that impressed.

Give me a good programmer who checks response codes, comments code and
follows a good design any day.

I do remember on rather large (15 programmers/1 year) project I managed
several years ago. One of them was one of these hot shots who was also
"well regarded" by management. But he wouldn't comment his code,
wouldn't submit his code for code reviews, wouldn't change his code when
it was reviewed - you get the idea.

I finally had to take it up with his manager. His manager's comments
were something on the order of "that's the way he is - you'll have to
live with it".

The only thing was - my contract made me responsible for the project.
To make a long story short, there was a lot of hemming and hawing on the
manager's part. But my contract gave me responsibility for successful
completion of the project - and control over the people on it. They
finally had to take him off the project.

And you know what? The project finished on time and within budget. And
the people on the project were much happier. Seems a lot of them had
problems with this "hot shot" - he wrote code that was fast and
efficient, but no one else could understand it, either.

Interestingly enough, when the company found the project ran so much
better with this guy, his reputation wasn't quite so hot.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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