Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constants and SYS(5) + SYS(2003)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00267724
Message ID:
00269319
Vues:
27
Hi Rick,

First, I agree with everything you wrote, and I think our understanding of how they work is much clearer.

Second, I think we need to look back to Mark's original question "Should I or shouldn't I do this?"

My original thought was YES, you should, it works, why not. Many other more knowledgable, and experienced programmers than I, said no. However, I now also think we shouldn't. To come to that conclusion I had to ask myself a few questions.

Q) Does this make my code easier to read?
A) Yes, CURRENT_DRIVE is more descriptive than SYS(5).

Q) Will I gain performance?
A) Unknown, but if yes will most likely be trivial.

Q) Will it be easier during maintainance to debug and will programmers who follow me immediatley understand how it works.
A) No. As seen in this thread, most VFP programmers will assume the constant to be evaluated at compile-time and will NOT give the correct value at run-time.

Because of this, IMHO, using CONSTANTS to represent sys() functions is not the best practice and should be avoided.

:)
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform