Use LOOPs to avoid excessive RETURNs
#4
Just the way I'm wired:

When I see "EXIT DO", I immediately think there must be more that needs to be done in the subroutine, and I wind up reading further into the subroutine to see what else needs to be done.  To then find out there is nothing else to be done.  And I'm left wondering: "why the heck did you make me read all the way to the end of the subroutine.?"

When I see "RETURN", I know the subroutine is done.  I need not read the rest of the code for the subroutine, and I can get back to looking at the code that brought me to the subroutine.

Regardless, very neat tip.  I do like to see how others organise their code.  Variety is the spice of life.

Keep 'em coming!
Reply


Messages In This Thread
Use LOOPs to avoid excessive RETURNs - by Pete - 09-12-2022, 03:28 PM
RE: Use LOOPs to avoid excessive RETURNs - by CharlieJV - 09-12-2022, 05:39 PM



Users browsing this thread: 1 Guest(s)