Re: Exceptions and Errors
| From: | Marcus Boerger | Date: | Tue, 13 Apr 2004 20:35:03 +0000 |
| Subject: | Re: Exceptions and Errors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-9121@lists.php.net to get a copy of this message | ||
Hello Christian,
Tuesday, April 13, 2004, 10:20:50 PM, you wrote:
> Marcus Boerger wrote:
>> 2) Use exceptions when a ctor needs to advertise its failure and in other
>> places where exceptions are really usefull.
> ... and make the exception in the ctor an option, not the default IMHO.
>> Too much exception is a bad thing anyway.
> Yes, it has to be a really severe error, otherwise you start putting
> try/catch everywhere making your code ugly and your error handling
> unmaintainable.
> We should try to help people resist the temptation of exceptions as they
> are a dangerous thing if not used very wisely (-:C
Yep!
Respect these rules
1) Exceptions are exceptions
2) Never use exceptions for control flow
3) Never ever use exceptions for parameter passing
--
Best regards,
Marcus mailto:helly@php.net