Re: resume after exception
| From: | Stas Malyshev | Date: | Thu, 05 Apr 2012 22:42:00 +0000 |
| Subject: | Re: resume after exception | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59356@lists.php.net to get a copy of this message | ||
Hi!
>> it's a wonderful mechanism with more uses than simply reporting errors
>> - the aspect of transferring control is what I find really interesting
>> about exceptions.
Exceptions should not be used for flow control. They are called
"exceptions" for a reason - to signify that something unusual
(exceptional) happened outside normal application functionality, which
now needs to be abandoned and the application should switch into "the
sky is falling, how I get out of it without losing too much?" mode. If
you're using exceptions for anything that is normal for your
application, you're doing it wrong.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227