Click here to Skip to main content
15,896,726 members
Home / Discussions / C#
   

C#

 
GeneralDataGrid "Refresh" Pin
vladmihai24-May-03 4:40
vladmihai24-May-03 4:40 
GeneralRe: DataGrid "Refresh" Pin
vladmihai24-May-03 5:12
vladmihai24-May-03 5:12 
GeneralC# Learning Curve Pin
Iceman24-May-03 4:10
Iceman24-May-03 4:10 
GeneralRe: C# Learning Curve Pin
Nick Parker24-May-03 4:56
protectorNick Parker24-May-03 4:56 
GeneralRe: C# Learning Curve Pin
peterchen24-May-03 7:42
peterchen24-May-03 7:42 
GeneralRe: C# Learning Curve Pin
leppie24-May-03 13:54
leppie24-May-03 13:54 
GeneralRe: C# Learning Curve Pin
Rocky Moore25-May-03 4:52
Rocky Moore25-May-03 4:52 
GeneralRe: C# Learning Curve Pin
James T. Johnson25-May-03 11:54
James T. Johnson25-May-03 11:54 
The style I use, which is (or was) adopted from MS's recommended style:

Uppercase first letter of each word on method names and properties.
camelCase* local variables and method arguments.
camelCase private member-variables in a class.

If you have an abbreviation, that would normally be all capitalized and it is only 2 or 3 letters long, then only the first letter gets capitalized (to fit in with MS's naming of the Sql* and OleDb* classes). I don't always follow this one, especially when I have something like CustomerID. Putting a lowercase 'd' there just looks wrong.

No m_ or _ for private variables.
Constants/readonly variables have uppercase first letter for each word.

*camelCase means to capitalize the first letter of each word, except the first, also Java style.

Rocky Moore wrote:
Some use the "this." to prefix member variables in usage (I think just so that they can use the intellisense ).

It depends, if you have a private member variable named myVariable and you need to use that variable in a method which has a local variable or argument, myVariable. To access the private member you need to prefix the name with this. otherwise you access the argument/local variable. Typically you see this with arguments because (to me) having a local variable of the same name just seems wrong.

James

"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him

GeneralRe: C# Learning Curve Pin
Rocky Moore25-May-03 15:16
Rocky Moore25-May-03 15:16 
GeneralRe: C# Learning Curve Pin
David Stone26-May-03 8:00
sitebuilderDavid Stone26-May-03 8:00 
QuestionDesign time control in Run time program? Pin
novachen23-May-03 21:24
novachen23-May-03 21:24 
AnswerRe: Design time control in Run time program? Pin
leppie24-May-03 0:30
leppie24-May-03 0:30 
GeneralPictureBox drag Pin
azusakt23-May-03 16:35
azusakt23-May-03 16:35 
GeneralImageList Pin
SherylK23-May-03 11:56
SherylK23-May-03 11:56 
GeneralRe: ImageList Pin
tuan_tomy25-May-03 21:44
tuan_tomy25-May-03 21:44 
GeneralListView Pin
hurlie23-May-03 8:30
hurlie23-May-03 8:30 
GeneralRemoving null characters from strings Pin
S O S23-May-03 5:01
S O S23-May-03 5:01 
GeneralRe: Removing null characters from strings Pin
NHM23-May-03 5:07
NHM23-May-03 5:07 
GeneralRe: Removing null characters from strings Pin
S O S24-May-03 1:35
S O S24-May-03 1:35 
GeneralRe: Removing null characters from strings Pin
Bo Hunter24-May-03 7:56
Bo Hunter24-May-03 7:56 
GeneralRe: Removing null characters from strings Pin
S O S24-May-03 10:41
S O S24-May-03 10:41 
GeneralRe: Removing null characters from strings Pin
Acidis31-May-03 9:33
Acidis31-May-03 9:33 
GeneralRe: Removing null characters from strings Pin
Acidis1-Jun-03 10:05
Acidis1-Jun-03 10:05 
GeneralRecordSets && DataSets Pin
NHM23-May-03 5:00
NHM23-May-03 5:00 
GeneralPlease help: System.Resources.MissingManifestResourceException Pin
Mertli Ozgur Nevres23-May-03 4:42
Mertli Ozgur Nevres23-May-03 4:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.