|
Posted by Chung Leong on 09/02/06 17:50
lawrence k wrote:
> My own feeling, obviously, is that it is better to error check
> everything, and to write extensive comments everywhere.
I think you're missing a basic point. Error messages and code comments
are form of human communication. The merit of saying something versus
not saying something obviously depends on how the listener makes use of
the information communicated. Aimless verbosity does no one any good.
If we look at the messages in your example:
"In getWeblogEntries, the function getRow failed to return an array
on the $i iteration."
"In getWeblogEntries, the query to the database failed."
Say I'm a programmer picking up your project, how would I respond?
Well, all I know is that there is something wrong in getWeblogEntries.
So I do a search for getWeblogEntries, open the file and look. Even
without your messages though I would have done the exactly the same
thing. The messages emitted by PHP gives me the file path and line
number, so they actually do a better job.
In programming as in real life, don't open your month unless you have
something worthwhile to say. A few judicious utterances is better than
a constant stream of banalities.
[Back to original message]
|