Re: PEAR's Error Handling and PHP5
| From: | Pierre | Date: | Wed, 07 Jun 2006 16:52:36 +0000 |
| Subject: | Re: PEAR's Error Handling and PHP5 | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-42832@lists.php.net to get a copy of this message | ||
On Wed, 7 Jun 2006 12:45:46 -0400
matthew@zend.com ("Matthew Weier O'Phinney") wrote:
> > I'm defitivally and totally against forcing design choices.
> > Exceptions usage is a design choice Understand you use them when
> > you consider you have not because a rule foces you to use them
> > everywhere as error handler or control flow.
>
> Using PEAR_Error is a design choice, too, and PEAR enforced that
> until PHP5 came along.
Wrong, we never force anyone to use PEAR_Error in a package. But to use
PEAR_Error (or derived) if the package needs an error handler. That's
not exactly the same thing.
> Can someone on-list provide some reasons *for* sticking with
> PEAR_Error? or some information on where exceptions *wouldn't* fit
> with PEAR?
For one, did I ever say that exceptions do not fit in PEAR? or do fit?
No. Because it is a design choice.
> Reasons other than "this forces design decisions" or
> "exceptions are evil"? I'd like to see some real, issues-oriented
> debate.
That's simply not possible, unless you are ready to discuss hundred of
cases one by one. We should simply allow both, even within one package.
I'm sorry, but forcing design choices is my main argument here and
that's why I was always against enforcing one or another (no matter
the php version).
>There are plenty of good arguments now why exceptions might
> be the right direction; let's see if there are some good arguments
> for PEAR_Error in a PHP5 world.
There is indeed a place for PEAR_Error (and derived) in php5, as well
as there is a place for exceptions in pear. One does not make the other
obsolete.
-- Pierre