Re: My Experience with PHP5 Error Handling (and possible
| From: | Greg Beaver | Date: | Wed, 25 Aug 2004 06:38:27 +0000 |
| Subject: | Re: My Experience with PHP5 Error Handling (and possible | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32930@lists.php.net to get a copy of this message | ||
Alexey Borzov wrote:
Hi, Greg Beaver wrote:Nothing is going to change the incentive to write for php5 - it's a better language than php4, and will undoubtedly supersede php4 within a few years as the primary web scripting language, precisely because of features like unifying error handling with exceptions and unifying API with interfaces.Having said this, I still think using exceptions is going to be the long-term answer for php5. Making a clean break with php4 will simply hobble php5, however, as there are just no useful packages for it yet (by useful I mean packages that top the list of downloads at pear.php.net)Let's look from a different angle: enforcing a PEAR_Error-like abomination will not add additional incentive for writing such php5 packages.
The packages *will* undoubtedly appear, only the "BC-keeping" solution will leave us with either 2 transitional periods 1) transition from pure php4 to "backwards compatibility" (tm) 2) transition from "backwards compatibility" to pure php5 instead of one *or* useless cruft on all the packages for the foreseeable future. And PEAR which is now rightfully mocked for PEAR_Error will be mocked for whatever sh*t it will accept in place of it.It's not this desperate. No one is suggesting that we cripple PEAR. I would personally like to investigate every possible clever change to PEAR that would allow existing packages to unify error handling with exceptions as soon as possible, so that the unique development challenges of php5 can be tested. For instance, I am writing a private php5 app that uses DB_DataObjects because I don't have any spare time to write a brand new php5-only version. If it is possible to smoothly transition from the existing PEAR_Error-based version to the new exception-based version when that comes out, I will be very happy. If not, then it is not possible. Why is it so tragically stupid to at least *attempt* to make this a possibility? Greg