Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement