One Brain Man

Monday, December 19, 2005

 

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.

Comments: Post a Comment



<< Home

Archives

May 2004   April 2005   May 2005   June 2005   July 2005   August 2005   September 2005   October 2005   December 2005   February 2006   July 2006  

This page is powered by Blogger. Isn't yours?

My Photo
Name: