Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable/field naming conventions
Message
From
27/03/2007 07:59:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/03/2007 16:42:42
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01208623
Message ID:
01208780
Views:
22
Alan,
I have been using Hungarian notation just for I was posting code here and people were already using it.
IOW not for I liked it - in fact I hate it. For example why would I prefix something like firstName with 'c' or receivedOn with 'd or t'. Having it as dReceivedOn doesn't really tell me it's just date and not datetime. When I change structure for any reason it's unlikely I'd revisit all the code to change it to tReceivedOn. Or a more striking sample IsReady - lIsReady reads ugly enough. Is it local variable IsReady or logical IsReady? If it's a local variable then there is m. (which I see more important then naming convention for a long time since VFP7). Still honestly just I post code often and wouldn't retype everything for posting I use somewhat:

m.llIsReady

I don't like it but I use it:( I'm a foreigner and I find it unnatural enough, why you find natural:) Wish we never implemented the Hungarian notation.

In .Net very short naming just makes sense, because the scope is generally few lines of code only and typed there. ie:
string myString;
using(TextReader r = new StreamReader("MyFile.txt"))
{
 myString = r.ReadToEnd();
}
for(int r=0;r<10;r++) { // something with integer r}
The scopes of 2 'r'are clearly separated and types are seen at once.
Cetin

>Now more and more of us are using more than one development language and/or database environment, I would be interested to know what you developers out there are doing regarding continuing the 'established' VFP standard of prefixing field names with the first letter of the datatype (c for character, n for numeric, l for logical, etc.) when you are working with other software.
>
>I am so used to it now that cFirstName, cSurname, cAddress1, etc. come more naturally to me than firstname, surname, address1... The more I look at other developers' work, or on-line demos in other languages, I have not noticed the convention used anywhere else apart from the VFP community. It's a pity it hasn't been adopted more widely. Is it used anywhere else?
>
>So...
>Are you keeping up the standard, and applying it to other development environments (ie. spreading the word, and the advantages)?
>Are you keeping up the standard for VFP only, but not for SQL-Server, C#, VB.NET, PHP, etc.?
>Have you abandoned (or not adopted) the notation in VFP because no-one else outside of VFP uses it?
>
>Any thoughts would be appreciated.
>
>
>Alan
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform