Re: Re: PEAR_Warning proof of concept
| From: | Sergio Carvalho | Date: | Mon, 12 Jul 2004 14:52:31 +0000 |
| Subject: | Re: Re: PEAR_Warning proof of concept | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31935@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Here is an example: You have build an application that fetches data from an external source. Now suddenly this external source is down. Still your application provides useful features without this external source, but your application wasnt build to cope with it missing. So now your application craps out until you refactored the entire code ..Pretty poor example, Lukas. If you've evaluated how the app will behave, and know it won't crap out anywhere else due to the data fetch error, then explicitly say so in the code (envelop the fetch method in a try/catch and demote exceptions to warnings). If you didn't evaluate the app behaviour on a data fetch error, then you're in fact praying that it won't explode spectacularly a thousand lines of code away from the error origin. In fact, you've just shown why I don't like error silencing -- even if I believe others may think otherwise, and PHP shouldn't deprive them from that 'feature'. Error silencing is common practice among PHP developers. It's generally bad practice, but it'd be a shame if people shunned exceptions because of old habits. I guess it's a lesser evil. Cheers, Sérgio Carvalho
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc