There are a lot of former Java developers at my company who use camel casing in C# for both of these. What casing is most widely accepted / used for C#?
Here is the Microsoft Conventions
Here is the full MSDN conventions
BindingSource BS = new BindingSource()
is the correct way? coz I've seen bs
and Bs
n00dles 2017-05-26 13:56
The most common casing is camelCasing
.
The Microsoft .NET Framework Reference Guidelines, require method parameters to be in camelCasing, since these are like local variables, I would treat them the same.
...and this one...
Internal Coding Guidelines (Design Guidelines, Managed code and the .NET Framework)
I like this one more, there is a clear-cut paragraph on naming/casing. It's only a tad more restrictive.
Exactly the same as in Java:
int someVeryLongLocalVariableName;
Camel Casing
The first letter of an identifier is lowercase and the first letter of each subsequent concatenated word is capitalized.
When an identifier consists of multiple words, do not use separators, such as underscores ("_") or hyphens ("-"), between words. Instead, use casing to indicate the beginning of each word.
The following guidelines provide the general rules for identifiers.
Do use Pascal casing for all public member, type, and namespace names consisting of multiple words.
Note that this rule does not apply to instance fields. For reasons that are detailed in the Member Design Guidelines, you should not use public instance fields.
Do use camel casing for parameter names.
The following table summarizes the capitalization rules for identifiers and provides examples for the different types of identifiers.