Code Style and Naming Conventions

Field Naming

_fooBar  - instance field.
__staticFoo - static field
FooBar - constant

Public instance fields are used in performance critical code instead of property accessors. The reasoning is that at time of writing properties are not being inlined by the 64bit JIT compiler[1]. To distinguish between public fields and public properties the fields keep their underscore prefix despite being public.

A StyleCop settings file exists in the src folder where StyleCop will auto-detect and apply it to all sub-projects/folders. The settings file disables some of the settings and thus a sub-set of standard StyleCope rules are tested.

Note. Due to restrictions in Visual Studio Express editions those editions cannot use StyleCop integrated in the IDE. This includes Visual Studio 2010 Express.


[1] Why are public fields faster than properties?
Comments