Game Development Reference
In-Depth Information
This chapter summarizes the standard coding conventions set forth by Microsoft
that should be employed in your code. Keep in mind that you should still read the
Microsoft Design Guidelines for Class Library Developers , but this chapter should
be enough of a generalization to get you started.
Styles of Capitalization
The .NET class framework uses three types of capitalization styles, presented in
Table 12.1.
Table 12.1 .NET Class Framework Capitalization Styles
Case Type
Pascal Case
Make the first letter uppercase as well as the first letter of each subsequent
word. All other letters remain lowercase. An example would be XmlSerializer.
Camel Case
Identical to Pascal case, except the first letter is not uppercase. An example would
be remotingEndpoint.
Make all letters capitalized when an identifier consists of less than three letters.
An example would be System.IO.
There are different situations when a certain capitalization style is appropriate.
The situations suitable for certain capitalization styles are presented in Table 12.2.
Table 12.2 Capitalization Style Situations
Appropriate Style
Pascal Case
Enum Type
Pascal Case
Enum Value
Pascal Case
Pascal Case
Exception Class
Pascal Case
Suffixed with Exception
Read-Only Static Field
Pascal Case
Pascal Case
Prefixed with I
Pascal Case
Pascal Case
Camel Case
Pascal Case
Protected Instance Field
Camel Case
Better to use a property
Public Instance Field
Pascal Case
Better to use a property
Search Nedrilad ::

Custom Search