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
Description
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.
Uppercase
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
Situation
Appropriate Style
Notes
Class
Pascal Case
Enum Type
Pascal Case
Enum Value
Pascal Case
Event
Pascal Case
Exception Class
Pascal Case
Suffixed with Exception
Read-Only Static Field
Pascal Case
Interface
Pascal Case
Prefixed with I
Method
Pascal Case
Namespace
Pascal Case
Parameter
Camel Case
Property
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