Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Few Newbie questions
Message
From
28/10/2010 17:33:38
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
28/10/2010 15:12:47
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:
01487432
Views:
44
>I'm generally with you on this one.
>
>Imagine you have a form with 3 tabs and 10 controls on each tab. When you look at the form properties and try to find the textbox on the 2nd tab that holds the value for the country, everything is listed alphabetically - the controls are not under their respective tabs. Everything on the form is listed alphabetically. So what is the easiest way to find it? Is it by looking for CountryValue rather than txtCountry or cboCountry? What if the type of control changes later? Let's say you switch from a textbox to a listbox. Do you need to change the name of the control? Doesn't really matter either way with .net actually....

Interesting questions to think about. I suppose no solution is perfect so kinda goes back to what Craig said; just be consistent.
Tim

>
>
>
>>>Prefacing a control with they type is generally frowned on in the .NET world. Yes, I know it's done alot in sample code. The Framework Design Guidelines say that things should always be spelled out unless they are commonly used/known, for example, Html.
>>
>>Hi Craig,
>>Interesting in the guide that was posted I didn't see anything about this. I do it because it helps me in intellisense like I mentioned. Not sure what the reason or value would be in leaving this off. What if I have a label and a textbox for a customer name. I can easily use lblCustomerName and txtCustomerName with no conflict. What would be the way to do this otherwise without adding Label or Textbox on the end which I fail to find any advantage to?
>>Tim
>>
>>>
>>>
>>>>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
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform