Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Davey
Hi Dave, Wednesday, May 30, 2007, 12:20:48 PM, you wrote: If there is no need to return a value then I don't do so. However, the function is going to process something, and surely you should check that the processing has succeeded or failed? I have exception and error handling dealt with

Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Davey
Hi Chris, Wednesday, May 30, 2007, 1:17:39 PM, you wrote: If there is no need to return a value then I don't do so. However, the function is going to process something, and surely you should check that the processing has succeeded or failed? This is precisely the point I was going to

Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Davey
Hi Paul, Wednesday, May 30, 2007, 4:07:00 PM, you wrote: I demur at your final point: If we don't use exit() and the function performs non-aborting error handling, it's going to return to the calling function which in most cases will need to know whether its child function succeeded or

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 10:25 am, Richard Davey wrote: Hi Paul, Wednesday, May 30, 2007, 4:07:00 PM, you wrote: I demur at your final point: If we don't use exit() and the function performs non-aborting error handling, it's going to return to the calling function which in most cases will

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 12:00 pm, Paul Novitski wrote: [snip] use the archives I think there is a LOT of value in bubbling up errors to the appropriate level of handling, and letting the right layer do the right job for the error. HOWEVER: it is not a good idea, imho, to always let the errors

Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Paul Novitski
At 5/30/2007 08:25 AM, Richard Davey wrote: In order that displayData() doesn't fall on its face, I would write the parent function in one of these ways: if (lookUpData()) displayData(); That's where our approach differs. If lookUpData falls flat on its face, my error handler will

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Paul Novitski
At 5/30/2007 10:51 AM, Richard Lynch wrote: On Wed, May 30, 2007 12:00 pm, Paul Novitski wrote: [snip] use the archives Good suggestion! HOWEVER: it is not a good idea, imho, to always let the errors bubble up to the outer layer, which is what Paul seemed to have typed... But didn't.

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Philip Thompson
On May 30, 2007, at 6:32 AM, Richard Davey wrote: Hi Dave, Wednesday, May 30, 2007, 12:20:48 PM, you wrote: If there is no need to return a value then I don't do so. However, the function is going to process something, and surely you should check that the processing has succeeded or