Friday, March 12, 2004
C# Naming Standards
As the C# pioneer at our Company, I've taken it upon myself to decide upon some C# coding standards. These are largely based on the
Microsoft design guidelines, but have been changed to make them (IMHO) friendlier to other .NET languages (e.g. Delphi).
As a result, I've tentatively decided on the following naming standards (I've only stated the ones that differ from the MS recommendations):-
Class instance members
Using camel casing prefixed by m (e.g. mSomeValue)
Method arguments
Using camel casing prefixed by a (e.g. aSomeValue)
Property names
Do not expose a property with the same name as its underlying type. This goes directly against what Microsoft recommends, but makes it easier for compilers that don't employ 'try, try again' scope resolution.
Microsoft design guidelines, but have been changed to make them (IMHO) friendlier to other .NET languages (e.g. Delphi).
As a result, I've tentatively decided on the following naming standards (I've only stated the ones that differ from the MS recommendations):-
Class instance members
Using camel casing prefixed by m (e.g. mSomeValue)
Method arguments
Using camel casing prefixed by a (e.g. aSomeValue)
Property names
Do not expose a property with the same name as its underlying type. This goes directly against what Microsoft recommends, but makes it easier for compilers that don't employ 'try, try again' scope resolution.