>I think it's just a matter of preference. I'd find my code more readable than yours :-}
I don't understand anything in that code. lol
>FWIW, here's what 'Code Complete' says on the subject:
>
>(a) Minimize the number of returns in each routine. It's harder to understand a routine if, reading it at the bottom, you're unaware of the possibility that it returned somewhere above.
>
>(b) Use a return when it enhances readability. In certain routines, once you know the answer, you want to return it to the calling routine immediately. If the routine is defined in such a way that it doesn't require any cleanup, not returning immediately means that you have to write more code.
The thing is about that is that on some specific methods, you have cleanup code. And, that goes usually at the end, before the Return. What if you return higher? You would then end up in moving the cleanup code into a private method and call that method from various exit points. But, then again, you would need to call it from various exit points instead of just having one pre Return lines to do it.
It is true I have seen some weird code on the Internet where a line contained about 8 calculations, thus 8 potential lines into one, and then, wow, try to fix something in that line, understand it or make it evolve. I guess this is mostly what I am targeting at.