Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Suggested prefixes for classes and objects
Message
From
27/09/2006 13:40:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/09/2006 11:39:03
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01157359
Message ID:
01157573
Views:
19
>>Peter,
>>I agree in general. However there are few points I do different and suggest to be that way.
>>1) FoxPro beautify tool reserved words and symbols 'No Change' unless you're doing it for small code snippets where you can see all code or you're sure beautify wouldn't cause hard to catch bugs. Several ways back I showed a case where beautify couldn't interpret a command line and caused hard to catch bug changing the casing. If your code has winAPI code in it you'd want to be sure their names not be touched at all.
>>2) oApp vs goApp. g is redundant. oApp is a well known public variable and it's the only public variable in an application.
>>3) 3 letter prefixing should not be so strict. ie: pg is just good for a page. Using btn,cmd or frm,top for same things are not good IMHO - overloading prefixes with properties. A button whether small or large is a button A form either toplevel,in top level or in screen is a form etc.
>>Cetin
>
>Thanks for the warning about Beautify.
>
>I use a number of public variables, all of which begin with "g". Is is true that you never have more than one? I like consistency.
>
>Same with prefixes: consistency. The three letters are a visual tipoff to me that this is a class.
>
>Frm = form class
>Pop = Type 1 SCX form
>Top = Type 2 SCX form
>
>There is a lot of difference between an SCX form and a form class. Are you sure that you would not want to communicate that difference in the name?
>
>Thanks for the feedback.
>
>Peter

Yes I never have another public variable other than oApp. It's also true that other than oApp all of my variables are local (and in my training classes I tell to the students that only type is local as far as they work with me or be good enough to prove me wrong).

Yes I'm sure I wouldn't want to communicate that difference in the name. Reason is simple, it in turn makes my classes hard to modify (when I do would I go and change all references say from frm to pop or other way?).

Cetin
Ç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