Re: PEAR's Error Handling and PHP5

From: Date: Wed, 07 Jun 2006 22:17:55 +0000
Subject: Re: PEAR's Error Handling and PHP5
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42849@lists.php.net to get a copy of this message
Lukas Smith wrote:
Hans L wrote:
I really don't want to revive a silly debate, but can you provide some concrete examples of how using exceptions in place of PEAR_Error would actually make prototyping slower? I know you've been saying that for years, but it just doesn't make any sense to me. In fact, I would say the opposite is true in my applications. I can only assume that you simply haven't used exceptions -- but I'm willing to be wrong!
Say you generate a report page. There are multiple graphs that are atleast partly generated from the same database tables. Now you want to change a single one of them that requires messing around with the table schema. Obviously this will break at least part of the other graphs. I do not want to spend a single second on those graphs however. So I do not want to start having to uncomment code, add a catch block around them. I just want to see how that single change will look inside the overall layout. Its irrelevant if the other graphs spout some error messages or simply incorrect data. The point is you have multiple independent methods, modules or whatever that interact on some level that means that you are likely to break one piece when messing with certain things in another.
Well ... isn't the point that if you have multiple, independent methods that you can test them in isolation?? I can imagine how a php page that aggregates the results of many isolated actions could suffer from this problem, but it seems like a problem in your app design. I suppose, though, that anything you propose as a problem, I'll simply say is a problem in your app design :) because I design apps to use exceptions. Ok - fair enough - I concede that the OO way is not the PHP way for everyone. ... But I might still suggest that it should be the PHP way for PEAR. ;) Hans

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