Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data-type prefixes in VFP code

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
0
0
GB

For years now we have had the integer data type in VFP, and if we are to follow the common notation of preceding with the first letter of the data type we should get field names like iStockQty or iBatchNumber, and local variables like liLoopCount and liNewRec. The thing is, I haven't seen adoption of this standard anywhere! In all the books and magazines I have read over the past few years, it appears that most developers are still using the 'n' prefix for integer values (maybe I'm reading the wrong books!).

Is this a case of old habits dying hard, or is the trend to keep the 'n' prefix for all numeric values, whether integer or not? (Or are we just lazy ;-))

I have been trying to adopt this new standard in my code, but can't help thinking that it still looks 'odd' and I can't get used to it.

What are other developers doing regarding the 'i' integer prefix? Any comments would be appreciated.

Alan


 
IF have been doing VB fo the last year, after 5 years of Fox (FP26 and VFP) and I must say that in the beginning the notations used in VB looked odd to me as well.

But I guess it is just a matter of getting used to...;-)

Since VFP is a weak typing language (at least used to be, haven't fully researched the new VFP 7.0/8.0, still lack the time), it was more to indicate that we intended to use a variable as numeric, since every variable was a boolean untill we assigned it a numeric value, than to indicate what it really was.

Of course with declaration of variable we have a whole different story. In this case I think it is prudent to use the correct prefixes, so it makes readibility much easier and prevents wrong use of variables.

Just my view on this one....have fun...life has just begun...





Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
I use Hugarina notation, which would mean using an "N" for an integer.
Hungarian notation. The first character denotes the scope of the variable and the second denotes the data type.


Scope Characters
L Local
P Private
G Global (public)
T ParameTer
Type Characters
C Character
D Date
L Logical
N Numeric, Float, Double, Integer
O Object
T DateTime
U Undefined
Y Currency


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top