Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
From
01/06/2001 23:02:52
 
 
To
01/06/2001 21:29:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00514145
Views:
14
Al,

SNIP
>>
>>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 ;-)
Clearly a matter of personal taste as I see it.
In my view LOOP and EXIT can significantly reduce the complexity (apparent and otherwise) of code. If I was going to outlaw Loop/EXIT I would simply have to replace them with (quite possibly multiple) IF statements where half of the IF does *nothing* as the IF's sole purpose is to recognize a condition and prevent execution of some code). I really don't see where that helps anything, particularly readability. And I have a personal distaste for revising a counter (to make it end a FOR) or forcing a condition (to make it end a WHILE) WITHIN A BLOCK OF CODE. To me an EXIT or a LOOP is far more obvious and makes for easier maintainability.

In any case my point was to argue that EXIT/LOOP does *not* make for unstructured code and on that I think we now agree.

Regards,

JimN
Previous
Reply
Map
View

Click here to load this message in the networking platform