Re: Exception misinformation

From: Date: Wed, 07 Jul 2004 01:49:51 +0000
Subject: Re: Exception misinformation
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31692@lists.php.net to get a copy of this message
On Jul 7, 2004, at 3:41 AM, Philippe Jausions wrote:
David Costa wrote:
On Jul 6, 2004, at 9:37 PM, Hans_L wrote: Eventually the "users won't know how to catch exceptions" argument it totally flawed. If they don't, they probably never used PHP 5 (or never used it extensively) therefore they will have little if no interest in PHP 5 only packages.
I got to disagree on that point. A PHP5 package could on itself be interesting without the user specially interested in, or knowning the ins and outs of PHP5. The interest is in what the package does for the user, not that's it's a PHP5 package.
Well for sure but you wouldn't go and install PHP 5 just for a package ;) I see your point and I don't really want to make adoption of any package a struggle but I do think that the users on PHP 5 know or are keen to learn how to handle exceptions properly. Still I just changed in my package Pear_Error to Pear_Exceptions and the end user result is identic: an error message on the screen.... this because many packages don't use warning or notices so realistically even without catching exceptions you will end up with a nice Pear_Exception formatted page with the error message et all.
To remedy that, I think good and simple examples of how to handle the exceptions thrown by the package are even much more important.
I agree
With PEAR_Error it's easy, you just check the return value, as one would normally do (even though, it's amazing how many people still don't check anything.) That's simple enough to not scare too many people. With exceptions, it requires educating oneself (not such a bad thing ;-), but it could create a barrier for some. The barrier could easily be lifted by examples, even if it's just to use that one package.
fine for me ;) but in my packages for instance the behavior of the PEAR_Error vs PEAR_Exception is really similar for the end user.
I can easily imagine when PHP5 will have a noticeable installed base, most users will continue to use it as PHP4.
Well then we shouldn't let them do that. PHP 5 is not meant to be used as PHP 4...
So the only way to go is educating users with easy example on how to use packages that throw errors...
Great, more then willing to add docs in this regard ;) Cheers David Costa
-Philippe


« previous php.pear.dev (#31692) next »