Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
From
01/06/2001 21:29:12
 
 
To
01/06/2001 18:29:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00514113
Views:
12
>>>SNIP
>>>>
>>>>I think George Tasker hit the nail on the head in an earlier message: that he considers them the equivalent of GOTO in Basic - with all the problems that causes.
>>>>
>>>C'mon Al, it's nothing of the sort.
>>>
>>>Goto can end up anywhere while LOOP goes to only one place and EXIT goes *only* to the place that you are going to go to anyways. There's a HUGE difference.
>>>I'm not arguing against your personal standard, just the justification you (and George) use for this particular one.
>>
>>Whoa there, bucko. First, you do know where a GOTO will end up: either at the line number or line label. Second, the objection to it and EXIT and LOOP is exactly the same. It leads to un-structured code that's more difficult to both read and maintain.
>
>Now now, George, you know what I meant.
>
>Yes, a GOTO goes to a line number which can be ANYWHERE (and that can lead to another GOTO which can later lead to another GOTO ad infinitum, in a spaghetti-like fashion).
>
>A LOOP goes to the TOP of the sole iteration process where it is coded. A EXIT goes out (to the bottom) of the sole iteration process where it is coded, which also happens to be the exact same place that the iteration will go when it is completed naturally.
>
>A GOTO definitely leads to unstructured code. A LOOP or EXIT does NOT lead in any way, shape or form to unstructured code. Since I have read you say that you use approximately 20 lines as your "standard" for coding any process I can hardly see where a LOOP or an EXIT would be difficult to discern or lend non-structure to your code.
>
>As I said to Al D., I don't argue with your personal standard.
>
>If you were to look at LOOP or EXIT as just a shorthand for an IF statement, which seems a legitimate viewpoint to me, then there is no real difference - both result in specific code being bypassed. And at least LOOP and EXIT do exactly what their words *mean*. The CONTINUE command sure doesn't (in my humble opinion).

I think we're discussing two slightly different things. You're right that with LOOP and EXIT you can visually trace what's going to happen next. My objection is that they slice through nested logic, which if coded elegantly may require cleaning up after itself when each level terminates.

I find when I'm coding complex logic and working from truth tables, there is no way I can even conceive of using an EXIT or LOOP. But then, that's just me ;-)
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform