Code guidline / code convention / naming convention for C#??

gicio

Regular
Joined
Aug 26, 2002
Messages
90
looking for something like a code guidline....

i.e. that a TextBox should have the prefix: txt


TextBox --> txt i.e. txtCustomer

Label --> lbl i.e. lblCustomer

String --> str i.e. strCustomer

bool --> boo i.e. booIsValide



is something like that anywhere available?




gicio
 
Doesn't really matter, as long as you're consistance. When I use C#,
I use camel case for everything (camelCase) where the first letter
is small. I don't use hungarian notation at all in C#.

isValid, customerName, cancelButton, are all kinds of things that I
personally use. However, I believe that in the MSDN there is a list
of the hungarian notation conventions. From the top of my head:

Form frm
TextBox txt
Label lbl
Scrollbars hsc/vsc
Slider sld
Panel pnl (?)
Picture pic
Button btn

For variables, I use (these are not necessarily "official"):
String s
Numbers (any kind) i
Boolean b
Char c
 
Back
Top