Use LOOPs to avoid excessive RETURNs
#9
Okay, spoofing aside, let's compare some pros and cons.

Pros - Pete's method:
Speed: Early exiting is faster.
Simplicity: Easier to write and read the condition statements.
Errors: No need to contemplate how to handle more complicated conditional statements where one statement might corrupt an upcoming statement. (ELSEIF and SELECT CASE also help when this is a factor).

Cons - Steve's method:
Steve came up with it. Big Grin

Well I do applaud anyone who can think through the logic of multiple conditional statements. That's a valuable skill set to have. I used to be more like that, but I would add so much to my routines overtime, I found myself too caught up with debugging how any new introduced condition would affect the existing routine.

Pete
If eggs are brain food, Biden takes his scrambled.
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 Pete - 09-12-2022, 07:36 PM



Users browsing this thread: 1 Guest(s)