Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
From
01/06/2001 09:33:39
 
 
To
01/06/2001 08:36:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00513731
Views:
13
>>Too bad. The effort they'd invest to understand why does this work would return tenfold once they realize they've become more profficient.
>
>I've also seen:
>
>
IF lVar = .T.
>    * Do something
>ENDIF
This one annoys me too, but it's all a matter of personal style - I ask myself if the code is understandable to anybody else reading it, if the answer is yes & the code works & the style has no effect on the efficiency of the code then it is just my prejudice against the style, so why complain & above all, I never (well, almost) touch working code just for the sake of style - I might introduce errors.

My prejudice against this style is coming from a C/C++ background, where true is defined as any value that is not false, specifically checking for false is almost acceptably (lVar==FALSE) but not for true - it is possible for
if ((lVar != FALSE) && (lVar != TRUE) )
to evaluate to true, whereas
if (lVar && (!lVar) )
will always be false.
Len Speed
Previous
Reply
Map
View

Click here to load this message in the networking platform