Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable Naming conventions.....
Message
De
14/05/1999 00:00:23
 
 
À
13/05/1999 23:16:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00218631
Message ID:
00218861
Vues:
24
> For example, variables are scoped by default to local so why use a local indicator unless the var is not local? I do use type indicators, though, for example: dToday, cName, nAmount.

Actually (not tryin' to dis- :-))-

variables are private by default, and only local after declared local. I have a horrible time with this... I name nearly all of my variable with lcLastName, and lnAmount etc, even though I haven't declared the variable local. Horrible habit, but I am just now beginning to break it. I truly wish that variables were local by default...

The only thing that has kicked me into beginning to declare all local variables is having been bitten a few times. For example I almost always use 'i' as a generic loop counter. But if inside a loop, I call a subroutine that also uses i for a counter, I'm hosed. So I am forced to declare i as local with LOCAL i.

BTW- my conventions are nearly identical to yours, with a few exceptions. I guess mabe I picked them up from codebook...

The only thing I don't like about CodeBook's conventions is the lv- rv thing for local and remote views. Why label a view as local or remote? If you prototype with local data and then deploy your app connecting to remote data, you would have to rename all of your views. That ain't cool-

BTW- if you stick to all of the conventions you named religiously, your a better man than I. I really do make a point of it, but I get lazy sometimes. But alas- my habits improve with each and every day. All the time, I review or maintain code that I wrote a few months ago and kick myself for my previous sins.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform