Re: PEAR's Error Handling and PHP5

From: Date: Fri, 09 Jun 2006 12:14:02 +0000
Subject: Re: PEAR's Error Handling and PHP5
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42885@lists.php.net to get a copy of this message
Hans L wrote:
Pierre wrote:
Hi, On 6/9/06, Hans Lellelid <hans@velum.net> wrote:
While, I can admit that procedural programming has its merits & its place in the world, I am surprised that it forms the basis for anti-exception FUD in PEAR, which is a collection of OO components ...
Hans, please consider that you are actually making statements based on nothing. Nobody said he is against excpeptions, *absolutely* nobody. We only do not want to for their usages, that's something completely different than being against ecxeption.
So you're saying that you're not against exceptions, you are just against their usage??? Is that kinda like saying that you're not opposed to taxes, you just don't want people to pay them? Wow ... I suppose that is completely different; thank you for that lesson in semantics!
The point is there is a disagreement about when to use Exceptions. Pierre for example already noted that he thinks using Exceptions to handle error conditions in the constructor is perfectly valid. Personally I prefer a factory() in case I need to handle things that might cause errors during the object creation. And so you can go through the list of possible things where some people might throw an exception and discover that people simply have a difference in opinion. Personally I do not like Exceptions that "leak" out of self contained pieces of code. This is exactly what a lot of people mark up as a "pro". So I am fine if a library uses Exception for internal purposes, just as long as it never leaks it out to me who is using the library. However the question is if there is a feasible compromise or not .. somewhere in between 1 solution to rule them all (be that Exceptions or PEAR_Error), everybody gets to pick what he likes. As you can see just looking at the two of us, we can see that we are at different ends of the extremes. Pierre is actually a bit more in the middle. regards, Lukas

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