Re: error handling in pecl extensions (was Re:intl/resourcebundle)
| From: | Stanislav Malyshev | Date: | Mon, 21 Dec 2009 21:17:48 +0000 |
| Subject: | Re: error handling in pecl extensions (was Re:intl/resourcebundle) | ||
| References: | 1 2 3 4 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6937@lists.php.net to get a copy of this message | ||
Hi!
It may be that for you style exceptions are excellent, but for many people using PHP exceptions are not something they are used to work with, and as such using exceptions for every problem would lead to either a very un-robust code (since any unhanded exception would inevitably propagate and break whole app or module) or obsessive try/catching. I've seen both in Java and it's not pretty. Of course, you can work with that too, it's a question of style and organization. Anyway, it is a topic on which there is significant difference of opinion. If there would be some consensus in PHP group regarding use of exception, some explicit guidelines that can be universally endorsed - it is not too hard to change intl error handling - it is centralized explicitly for the purpose of being flexible. But I would like to keep it unified at least within one module. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.comWe've discussed this before I think—the general idea is that we definitely do *not* want INI settings that change this sort of behavior as they remove control over error reporting/handling from the developers.I acknowledge I'm plainly pro exceptions - and I regularly override PDO's default behaviour. Now, if more and more extension offer such an option, wouldn't it be easier to have a "common" option to define a default?