Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If you code like this.... you might be a crappy coder
Message
De
04/06/2021 16:22:11
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
30/05/2021 22:51:02
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01680754
Message ID:
01680931
Vues:
46
>>Who asked you? Your problem is you think you're a genius and you just can't keep your opinion to yourself.
>
>You don't have a mirror at home do you ? You have described yourself perfectly.
>I'm not the one forcing crappy opinions down others' throats.

Yes you are. Your opinions are not factual. Mine are. Those who think themselves experts really annoy those of us who are. You are irrelevant. Stop harassing me.

>
>
>
>
>
>
>>
>>>WARNING: For the casual reader.
>>>
>>>Its very bad advice to use STORE of many variables over the individual initialization of variables.
>>>Individual initialization allows for better readability, especially when values might change over time.
>>>
>>>True it has some performance advantage, but it is so tiny that has no practical use except in the utmost extreme cases.
>>>
>>>
>>>
>>>
>>>
>>>>
select subs_var_select
>>>>set filter to ordnmb=m.ordlin.ordnmb and lnline=m.ordlin.lnline
>>>>go top
>>>>wRepriceStones = .T.
>>>>nStyle_Stone_Price=0
>>>>nOrdLin_Var_Price = 0
>>>>nDiamValu = 0
>>>>nClrValu = 0
>>>>nProtected = 0
>>>>scan
>>>>
>>>>vs
>>>>
>>>>
wRepriceStones = .T.
>>>>store 0 to nStyle_Stone_Price, nOrdLin_Var_Price, nDiamValu, nClrValu, nProtected
>>>>SELECT subs_var_select
>>>>SCAN FOR ordnmb=m.ordlin.ordnmb AND lnline=m.ordlin.lnline
>>>>
>>>>The second batch of code takes less time to execute and less time to step through in the debugger. It's easier to understand. These are facts, not opinion. A set filter, then a go top is wasteful. Go top is not going to respect the filter, even if it is optimized. Scan does a go top by default.
>>>>
>>>>I write it the second way and have done so for many years, while I see things written the first way far too often. It's not my fault there are programmers who can't tell the difference. They keep holding development back and all the boot-camp wannabees are not improving things.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform