Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Argument starter - The roots of all evil
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00938079
Message ID:
00938630
Vues:
34
George,

SNIP
>
>I'm not saying never to any of this. I am saying that in many cases there's no quantitative reason for doing things otherwise. Consider
IF (a = b) THEN
>  RETURN .F.
>ELSE
>  RETURN .T.
>ENDIF
Instead of simply
RETURN (a = b)
I don't see why anyone would have a problem with EITHER of the situations above. It sure wouldn't be a factor in any hire or not decision on my part.

>The same applies to LOOP, which really does nothing other than making the code less maintainable. EXIT, IMO, shouldn't ever be used. How many times have you seen
DO WHILE .T.
>  * Lots of code here and then...
>  IF (a = b) THEN
>    EXIT
>  ENDIF
>ENDDO
rather than
DO WHILE (a = b)
>  * Lots of code here
>ENDDO
I rarely use WHILE .T. myself but I do want to point out that your 2 bits are not equivalent. When I do use WHILE .T. it is in the case where a = b is not so at the start but will become so, possibly, applyinh logic in the *LOTS OF CODE HERE part.

cheers
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform