Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field name tips wanted
Message
From
13/12/2000 23:04:45
 
 
To
12/12/2000 14:47:35
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00452241
Message ID:
00453225
Views:
15
>I don't particularly like underscores either, but they do give readability when browsing or copying to Excel.

I've come to dislike underscores intensely for the simple reason that I find it hard to remember where I used them and where I didn't. I'll remember every other character in the field name and be unsure about the underscore.

I use camel case instead and like that very much.

I do use hungarian notation for field names:

c character
d date
i integer
n number
t datetime
y currency

For instance I just created two new fields tonight to record when a timeshare reservation is assigned to an agency (like the rental office). The fields are:

dLastAss -- date of assignment
cLastAss -- agency code

So I don't never have to spell out "date" or "number" in a field name this way. The relationship between the two fields is obvious.

I have one other naming convention that I like alot. Every table has a primary integer key. If the table is named MYTABLE then the key field is named:

MYTABLE.iMYTABLE

with the table name in all caps.


If another table refers to that key it looks like this:

SOMETAB.iMYTABLE


If I store that value to a local variable, it is named:

liMYTABLE

My primary and foreign keys really jump out of the code this way. (I also put VFP keywords in lower case because so the contrast is even greater.)


Peter
Peter Robinson ** Rodes Design ** Virginia
Previous
Reply
Map
View

Click here to load this message in the networking platform