Game Development Reference
In-Depth Information
Naming Attributes
There are not a lot of guidelines for attribute naming, but be sure to use Pascal
case. The only rule is to suffix the attribute type name with Attribute .
Example:
InterfaceControlAttribute
Naming Enumerations
When naming enumerations, the standard is to use Pascal case for both type and
value identifiers.
Abbreviations should be used only when absolutely necessary. They cause confusion
when reading code, and they break from the standards used in the class framework.
Never suffix an enumeration with Enum . The identifier name should also be singu-
lar unless it is a bit field, in which case the name would be plural. Additionally, bit
fields should always be marked with [FlagsAttribute] .
Example:
public enum InterfaceColor
{
Red,
Black,
Yellow
}
[FlagsAttribute]
public enum InterfaceColors : short
{
Red = 0,
Black = 1,
Yellow = 2
}
Naming Static Fields
When naming static fields, the standard is to use Pascal case. Additionally, static
fields should be named using a noun, noun phrase, or abbreviations of nouns.
Lastly, never use Hungarian notation or any other sort of prefixes or suffixes.
Search Nedrilad ::




Custom Search