Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constants vs Locals
Message
De
28/09/1999 23:18:47
 
 
À
28/09/1999 22:49:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00269906
Message ID:
00270337
Vues:
33
>>>...And they kind of give a more "cluttered" look to the code. So I'm in conflict about it right now :)
>>
>>It's a convention that constants be entered in all uppercase, but not necessary. You can use mixed or lower case if you want. That may help with the cluttered look.
>
>I use an alternate "standard" for contant names, I preceed them with an "h" and a type letter, eg. hnPi
>
>In my mind the difference between a constant for Pi and a local variable for Pi is the scope. A constant is accessible in many places beyond the immediate function or method. So we should use a scope indicator to show that.
>
>And it does have a type which should be revealed just as we do with a local variable.
>
>I like "h" because of the association with "header".
>
>Just my two cents.
>
>Peter Robinson

That convention looks as good as any and makes sense.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform