Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object Naming conventions
Message
 
To
07/11/2006 10:42:44
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01167628
Message ID:
01167674
Views:
9
UI naming is what I'm after. I found naming conventions that work for everything else. No one seemed to really touch on UI control naming though.

Thanks.

>I think consistency is the key more than anything else.
>
>In our app, all the names of our forms pretty much follow the same convention, and we also typically differentiate between a regular form and a dialog form. So, we'll have something like:
>
>PersonnelForm
>GetNameDialog (or some developers may have also used GetNameDialogForm)
>
>As far as controls go, all our TextBoxes are like:
>
>txtFirstName
>txtLastName
>
>Coming from the FoxPro world, we carried over the old naming convention for most of our buttons:
>
>cmdOK
>cmdCancel
>
>A few of our developers didn't follow that naming convention with buttons (because they weren't ex-Foxers) and so in a few areas of our app the buttons are:
>
>btnOK
>btnCancel
>
>That drove me nuts, because it was inconsistent with most of the rest of the app, but ... oh well.
>
>Now, that's the extent of using that kind of naming convention (I suppose that's hungarian notation). It does *NOT* extend to field, property or other object names. We *ONLY* use it for UI controls.
>
>YMMV
>
>~~Bonnie
>
>
>
>
>>I saw a post on here about naming conventions and avoiding hungarian notation. So here's my question posing as an example:
>>
>>I have a form with let's say a button whose text is 'OK' that simply closes the form. Would it be more .NET-friendly to name the objects so:
>>
>>
>>Form1.Name = 'formMine'
>>Button1.Name = 'buttonOK'
>>
>>OR
>>
>>Form1.Name = 'MyForm'
>>Button1.Name = 'OKButton'
>>
>>?
>>
>>I'm coming from the hungarian camp but I tend to think about those that have to maintain after I'm gone.
>>
>>Thanks
>>
>>Richard
State of Florida, DCF
Previous
Reply
Map
View

Click here to load this message in the networking platform