Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Advantage and disadvantage of funct PRG
Message
De
04/12/2017 18:06:49
 
 
À
03/12/2017 18:29:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01656009
Message ID:
01656124
Vues:
99
>Actually finding things in project manager is the only reason against having each thing in its own prg, because it would clutter the pjx. On the last few projects I did the number of free-floating functions was reduced drastically by grouping them into objects (by purpose), which are then instantiated as singletons - but the function calls are still in too many places in code, so there's usually one big prg with just stubs - something like
>
>function GetAppRootPath()
>return app.oPaths.approot
>
>So instead of having getAppRootPath.prg, getAppLaunchPath.prg, getUserDocsPath.prg, getTempPath.prg, etc, there is just libPaths.prg, etc etc. The remainder are the few dozen functions which didn't have a natural global object which would host them.

Disagree totally ;-)
In my book such access paths should be shortened/automated, yes, but not via function or method call but by compiler constants -
skip the overhead of calling in the next stack level (yes, I know without parameters calling is much faster...)
If you keep all constants in upper case, whenever a constant shouts repeatedly in the code I am working on, I automatically cache the (possibly reached via long and convoluted way) access result in a local var ;-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform