Re: Re: PEAR_Warning proof of concept
| From: | Lukas Smith | Date: | Mon, 12 Jul 2004 12:42:11 +0000 |
| Subject: | Re: Re: PEAR_Warning proof of concept | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31917@lists.php.net to get a copy of this message | ||
Hans Lellelid wrote:
Lukas Smith wrote:Not really. The code in question might be nicely layered with thoughtful methods doing only very specific tasks. But the fact remains that calls to this external site are scattered within your business logic. It might just be that this external source used to be an internal source etc. The point I was trying to make with this example is that forcing people to do things a certain way is limiting. It is nice to have the option of forcing oneselves to a certain style, but there are moments where you really really have other things to do than refactoring your application (let alone someone elses). You seem to approach error handling from the view point of unlimited time and ressources (at every stage of development/maintainance). However PHP is used often where exactly this is not the case as choice and flexibility in the solutions is until now the main selling point over other solutions. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07Well, in that example it seems very straightforward to just add a try/catch block around the external fetch call ... or a try/catch block to the data-getting layer in general; you'd most probably need one there anyway. It seems that fairly basic application design should ensure that your code can be made to continue functioning if the function of a particular layer stops working.Implementing a workaround for a built-in language feature -- i.e. throw() -- for such a questionable purpose just seems like a bad idea.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 ..