Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this a Y2K problem?
Message
De
03/01/2000 12:34:00
 
 
À
03/01/2000 11:56:15
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00311693
Message ID:
00311751
Vues:
17
>>Yep. It's called misuse of macro-expansion. Macro-expansion is neither needed nor desirable where you are simply using it to expand a name - you're giving VFP's interpreter the opprtunity to miscue early and often. Instead of using the macro-expansion operation, use name resolution by encapsulating theings that are names within parentheses - VFP can't misparse the name this way due to embedded delimiters, and it's faster and more reliable as well.
>>
>>Jim Booth's thread on the 10 most misused VFP constructs was right on the money - misuse of macro expansion is one of the worst culprits, and results in more head-scratching than almost any other part of the language, because programmers make poor assumptions about what's actually happening when macro-expansion takes place. If you need to get the command line parser involved in runtime interpretation of the command as a whole, then macro-expansion may be warranted; using it to replace a name at runtime means you've taken the lazy approach to handling the problem without regard for what is needed or desirable.
>>
>
>I hope you didn't mean these comments to be as condescending as they sound. I'm netiher lazy nor a poor programmer. I may not have understood the differences between name expression and macro-expansion as well as you, but I thank you for clarifying the problem.

(1) Programmers are by their nature lazy - the best of them are creatively lazy.
(2) We all make assumptions that bite us. The problem here is not understanding either what is a valid name from the VFP standpoint, or not knowing how SYS(2015) functions. The key word is not knowing. Ignorance is correctable. Stupidity and pig-headedness are with us forever.
(3) Making poor assumptions doesn't make you a poor programmer; it does help explain why otherwise competent people make boneheaded mistakes. Poor programmers tend to make more of them and will tend to dig themselves a deeper hole trying to fix them.
(4) Trying to exploit a side effect without understanding how that side effect may change is a certain way to get bitten, and to make the thing biting you have sharper, nastier teeth.

Jim's thread on things that get misused in VFP is spot on. Maybe reviewing what you do and checking to make sure you remediate your approaches to avoid the problems will result in fewer confused January mornings.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform