Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To iif or not to iif = .t.
Message
De
01/06/2001 09:33:39
 
 
À
01/06/2001 08:36:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00513276
Message ID:
00513731
Vues:
14
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform