Having multiple return statements like that has no effect on the stack, the return statement only comes into play when it is executed.
However it's a programming style question that comes up now and again and one I contemplate again and again.
When I see horrible code like this:
I want to change it toCode:IF A THEN IF B THEN IF C THEN IF D THEN do something END IF END IF END IF END IF
because from a debugging and comprehension standpoint I find it easier to be able to get out of the processing chain as soon as possible. I don't want to have to work through all those nested IFs wondering what's going to happen next.Code:IF NOT A THEN RETURN IF NOT B THEN RETURN ... etc
It's easier for me to read, write and test.




Bookmarks