Naming Guidelines and Visual Controls
According to the .NET naming guidelines it is often suggested to adopt camel case for private properties/fields and pascal case for protected and public properties/fields.
It is unclear how to name visual controls. Let consider a standard label which is protected in a web form. We could name as following:
- LblFirstName (classic pascal case for protected fields)
- StaticFirstName (contro, agnostic version)
- lblFirstName (as usually I do)
- _lblFirstName (C++ style)
For read/write controls we could use:
- TxtFirstName
- ReadWriteFirstName
- txtFirstName
- _txtFirstName
During these last 10 years of development I changed my programming style. I started with 4, then moved to 3. Today I'm thinking about the 2.