Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00514366
Views:
12
Jim,
>>It is unstructured since changes the normal logical flow the code, like GOTO does. Sure LOOP goes to the top of iteration structure, and EXIT to the line immediately preceeding. In both cases, however, they can make maintaining the code more difficult, since they corrupt the logical sub-ordination of the indentation structure. And there's no arguing about this, since that's the purpose of indentation.
>
>I wasn't aware that indentation was the definition of "structured code". I yield - you are correct.
>
>I will pay the price when necessary because my personal preferences are (as regards this):
>1) readable code;

I'm fond of saying, "If it ain't readable, it ain't maintainable". Let suggest that doing away with LOOP and EXIT can make code more readable. Consider the following:
DO WHILE   DO WHILE 
  * Some code here       *Some code here
  IF                  IF NOT 
    LOOP && or Exit                              * This shows the logical subordination
  ENDIF                                          * of the code to the left
  * This is logically           ENDIF
  * sub-ordinate to the
  * logical NOT of the above
ENDDO                                        ENDDO
>2) code that does not 'force' a condition (counter beyond value or condition now obviated) WITHIN A STRUCTURE (this is a problem in waiting);
>3) code that does not continue to process the loop condition when it is no longer necessary (IF condition(s) detects nothing more required so they do nothing but allow the natural loop to complete). This is just wasteful.
>
>Your preferences are what they are and mine are too. They both end up with working programs.
>
>Regards,
>
>JimN
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform