Re: My Experience with PHP5 Error Handling (and possible

From: Date: Tue, 24 Aug 2004 22:36:06 +0000
Subject: Re: My Experience with PHP5 Error Handling (and possible
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32924@lists.php.net to get a copy of this message
Greg Beaver wrote:
How fast can you migrate DB, DB_DataObject, and HTML_QuickForm to use exceptions. Oh, and you can't break BC unless you release them as DB_v2 , DB_DataObject2, and HTML_QuickForm4, or set up another channel, or...
I think its pretty consensual that you'll need to break BC in order to move to PHP5. It may be done by issuing new versions (DB2, DB_DataObject2, etc) or using channels. I personally think channels are cleaner, but that's another discussion altogether.
hmmm, this might take a while. Let's set aside the "you shouldn't be doing that" and instead look at what is physically possible. It is not physically possible to migrate all of the critical php4 packages to php5-only.
And lets set once and for all that it is impossible to use exceptions in a PHP4 compatible way.
Who here would rather just rewrite DB_DataObject from scratch with the same API for PHP5? How about phpDocumentor? *shudder*
Anyone with an itch to scratch, as always. I don't use DB_DataObject, but my own equivalent package (DB_OO). I wrote it in under a week, and I'll rewrite it for PHP5 in a couple of days. No big deal.
Simple and elegant is only simple and elegant if you can actually use it effectively in a simple and elegant way. Actually, I believe simple is only useful if it is simple to debug - a clear difference from simple to code. It's very simple to code a bunch of gotos in BASIC :). 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 competition have a go. Let a clean break be done. PHP4 packages can be used, at the expense of uglier error handling (sometimes exceptions, sometimes PEAR_Error/PEAR_ErrorStack). I'm sure PHP5 will gain traction on a perfectly reasonable timeframe. Don't cripple PHP5 PEAR packages forever.
Greg


Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.dev (#32924) next »