Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding conventions
Message
De
02/01/2004 08:43:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
02/01/2004 02:42:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00863303
Message ID:
00863412
Vues:
11
>>My question is about naming variables. For numeric variables, the second letter of the variable name (the type) is usually an "n". Now, if the variable will contain only integer data, you might also use the letter "i" for the variable type. Does anybody do this, or recommend this?
>>
>>I have been using "n" for several years, whether the variable contains integers, or real numbers.
>
>I'm not doing it and wouldn't do. If some day I decide to change an int to a double it'd mean to change var names too (convention wise). An int is a field type and in the same manner c for chars and m for memo would be ugly.
>Honestly I never liked the convention. I use the convention for 2 reasons :
>-To match the UT community in my codes posted
>-To prevent name clash with PEM namings.
>Otherwise actually I find it nonsense to name say 'FirstName' as 'cFirstName' or 'ShipDate' as 'dShipDate'. For the latter dShipped would seem to be a shortcut but I don't like it, Shipped might be a date or boolean and I prefer ShipDate, Shipped instead vs dShipped,lShipped. IOW I try to include type clue directly within the name rather than prefix.
>Cetin

Thanks.

Some suggest using types for fields (cName, dDate, yCost), which I don't do. I do use the convention for variables: lcName (l for "local", c for the type).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform