Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Few Newbie questions
Message
From
28/10/2010 10:19:51
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
28/10/2010 10:18:29
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01487336
Message ID:
01487378
Views:
42
>No reason, just a preference thing. I saw the convention somewhere when I was young and impressionable.'

Oh gosh, you still look young! Compared to me anyway.

>
>>Hi Mike,
>>
>>Why do you prefer "SaveOrderButton" instead of "btnSaveOrder" ? All the recommended junk aside, intellisense is a wonderful thing. If I am trying to access a button and I type "this.btn" I will see all my buttons in intellisense. I ususally know it is a button I am looking for but not always if I named it "SaveOrder" or "OrderSave" I am not criticising mind you, I am just curious if there is some reason I am overlooking by having the word "Button" or "Textbox" and if so, why at the end where intellisense has less value.
>>
>>I never did understand the underscore thing but I know it is popular. It just shows how much I don't like reaching for the underscore button I guess.
>>Tim
>>
>>>All IMO:
>>>
>>>1) LogonForm, NameButton, InputTextBox
>>>2) Yes, depending on the scope of the variable. If it's a class-level member variable it should be prefixed with an underscore.
>>>3) Nope.
>>>
>>>>Ok,
>>>>
>>>>just created my first little application in C# and have a few "what's best practice" type questions;
>>>>
>>>>1. What is the expected practice for naming controls? frmLogon, btnName, txtInput etc?
>>>>
>>>>2. Is camelCase still best policy for variable naming?
>>>>
>>>>3. Should variable names begin with and identifier of their type? intCounter, strBuffer etc?
>>>>
>>>>I know in reality it will not make my code run faster/better but I would like to follow standard practice. Are there any other "recommended practices" that would be different to what I am used to in VFP?
>>>>
>>>>
>>>>Gary.
>>>>
>>>>PS. is there a .Net equivalent to VFP's beautify?
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform