Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shutting Down the Computer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00532885
Message ID:
00533418
Vues:
10
>>And don't define CR, use local variable instead... Learned recently this from George Tasker...
>
>Thats a pretty definitive statement with barely anything to support it. Why use a variable? Can a variable be defined in one place and referenced many applications thousands of times? If its #DEFINEd in a Header file it can be, and guess what, the value of a CHR(13) is constant, there's really no reason to make it a variable. The only time it might cause a problem is when its used millions of times in a loop, the function call might add a wee bit of over head. Hardly the case in what Mike posted.

Mike,

Let me clarify this (since my name is involved again) once and for all.

Do I believe in optimizing my code from the beginning?

Yes

Do I believe that fastest isn't always best?

Yes

These two statments may seem to be in conflict, but they really aren't.

It is, as far as how I approach things, always best to optimize the code from the beginning. This does not mean, however, that I always use the fastest technique. An example of this is a FOR...NEXT iteration struction versus a DO WHILE...

As a programmer, I am constantly required to evaluate the problem and come up with a solution. In many cases, I may have something already in the "toolbox". This doesn't mean, however, that I blindly implete the existing solution. Rather, it means that I examine it and, if necessary, modify it in such a manner as to not break existing programming. Furhter, the module must be proved in order to assume that any modifications work as intended.

Is using #DEFINE with a function slower than otherwise?

Yes.

Does this mean we should never use it?

No! It simple means that we should evaluate the context and respond as necessary.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform