Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
From
31/05/2001 14:42:48
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00513338
Views:
23
>Well, if it's a pet peeve, I can assure you that you're not alone. < Puts on fire suit against the upcoming flames > One thing that I think Foxheads don't handle as well as programmers in some other languages, or at least it used to be so, is the handling of Boolean values. My biggest peeve is the something like the following:
DO WHILE .T.
>  * Bunch of code here
>  * Leading to...
>  IF llcondition
>    EXIT
>  ENDIF
>ENDDO
rather than
>llcondition = .F.
>DO WHILE NOT llcondition
>  * Bunch of code here
>  * Including a statement like
>  llcondition = < Logical Expression >
>ENDDO
Of course, this is just IMO, so I could be wrong.:-)

I agree entirely. I consider EXIT and LOOP to be bugs until proven otherwise :-) Almost without exception, it's an indication that the coder hasn't thought the logic through clearly, making the entire structure suspect.

Personally, I also consider an IF statement without an ELSE in the same class.
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