Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this a best practice?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00925541
Message ID:
00925564
Vues:
16
>Or does it NOT make a difference?
>
>At the top of my Main.PRG, before READ EVENT, I issue this code:
>ucRootDirectory=SYS(5)+SYS(2003)
>ucPath=["]+ucRootDirectory+["]
>SET PATH TO (ucPath)


>My understanding is that a program like FileMon, would present a less clutered assessment of my VFP Install runtime.

Terry,

Let's first define exactly what a "Best Practice" is. IMO, a "Best Practice" is one that somehow enhances the readability or maintainability of the program or, hopefully, both.

Several questions arise here. The major one from my POV is, "What about the path set in the configuration file?" In the above case, what you're doing is either completely changing it or it isn't being set. Does this enhance the program? IMO, it doesn't.

Another thing is that you're cluttering the main program with this code. Why not create an "Environment" object that handles something like this?

One of the biggest misconceptions, IMO, about programming is the, "Well, it's only a couple of lines of code". It doesn't matter how many lines it is. I've written stuff that was two lines long in their own method. What matters is that the code is re-usable, functionaly cohesive and easily maintable.

The question for you is, "Does this meet the above criteria?"

Regards,
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