Re: Exception misinformation
| From: | David Costa | Date: | Wed, 07 Jul 2004 14:53:35 +0000 |
| Subject: | Re: Exception misinformation | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31720@lists.php.net to get a copy of this message | ||
On Jul 7, 2004, at 3:49 PM, Lukas Smith wrote:
snip
I respect your view and perhaps your idea that PHP 5 will not replace PHP 4 for developers and users explains your sentiment very well. You are probably right and I am far from knowing when PHP 5 will gain a large user base but..not too far ;). I would see a problem in handling PHP 5 errors or force PHP 5 developers ( which do use PHP 5 today ) to use a PHP 4 mechanism adapted to PHP 5 to achieve the same result.It sounds like this time you should re-read David's post. His statement was that exceptions are already a part of PHP5 and his example was that SQLite will throw an exception if you try to connect & it fails. Ergo, people using SQLite in PHP5 need to know how to catch exceptions.It sounded to me that he was suggesting that since PHP5 extensions use exceptions and that using them for any type of error handling is fine. Anyways I will take this opportunity to clarify that I am not against PHP5 or exceptions. I however dont see PHP5 immediatly replacing PHP4 for the large bulk of our developers and users. I also dont feel that exceptions should be used for anything but errors in the enviornment that php runs in.
This is correct but if PHP 5 decided to go in one direction we can't ignore that and see PHP 5 as something to adapt PHP 4 packages to.It puzzles me that you criticize me for not listening to anyone else's opinions and then also criticize me for suggesting that we use what we've learned from others as the sole source of inspiration. (I assume that's your suggestion, as I'm the one who said that George's book was a good guide for exception use.)In case my use of the word "sole" didnt make it clear what I said. here is the full quote again: "while its good to learn from how other people do things, they shouldnt be our sole source of inspiration of how we do things. in this particular case the example David brought up it was not even proving the point he was trying to make." Another try to bring across my message: Just because other people do things a certain way does not mean we have to do things in the same way.
However other peoples ways of doing things do serve as an inspiration. They should just not be our sole soruce of inspiration. Frequently in this thread argument were presented saying: If we do things this way we will be all alone, because nobody else is going to be equally stupid/reluctant to change. I take offense at this type of reasoning and I was expressing this.I am always opened to alternatives. In fact I was as reluctant as you with exceptions (and I used PEAR errors in my PHP 5 draft package) but since we agreed on having PHP 5 packages to work under E_STRICT including PEAR was a problem and exceptions was the solutions. PEAR_Exceptions did the work and whilst I don't see a problem in using something else, I don't see any valuable alternative now.
snip
So in conclusion I have presented my argument, you have presented yours. Not using exceptions at all is the status quo. I think we will certainly agree to change this status quo for PHP5. Now the question is to define the limits. I think you can give your argument a nice boost by writing up a thoughtful RFC to regulate the use of exceptions. I may do the same for mine. I don't think that such RFC would make sense till PHP 5 goes stable. It is very clear to me that the knowledge of exceptions is somehow limited at this stage or let's say the majority of developers didn't use exceptions yet beside some quick tests.Any vote based more on assumptions then practical experience might not serve the best interest of the community, of course this is just my opinion. Regards David Costa