Game Development Reference
acceptable for personal projects but unacceptable for commercial software. All
developers should follow a common style so that no matter who wrote the code, it
always looks like a single person programmed the entire application.
A common practice to outline how all code should be formatted is to release a cod-
ing standards document to the developers. They are to abide by the rules and best
practices set forth in the document to promote the creation of code that is easy to
read and maintain. Looking through code that you did not write is much easier
when everything follows the same style and is neatly commented, with explanations
for all the complicated constructs present in the code. Using coding standards will
increase both productivity and efficiency through a consistent style, delivering the
end product at a lower cost. In addition, coding standards reduce the risk of inte-
gration with other components developed by other companies, groups, or team
The usage of design patterns and how modules are coupled can also be described
in the coding standards document. Some design patterns are frowned upon
because they typically promote tightly coupled design, making the code harder to
unit test among other things. This document can be used to define acceptable
design patterns to use, and which ones to use only if necessary.
In addition to documented standards, Microsoft has released a great tool to help
with the actual enforcement of coding and development standards. Microsoft has
published design guidelines for all .NET applications to follow, and FxCop is a tool
that uses reflection, MSIL parsing, and call-graph analysis to inspect assemblies
for over 200 violations of the design guidelines. Custom rules can also be created
specifically to your own guidelines and used within FxCop. Some of the default
rules check for conformance issues with library design, localization, naming con-
ventions, performance, and security.
FxCop can be downloaded at http://www.gotdotnet.com/team/fxcop/.
As discussed numerous times throughout this topic, the importance of developing
tools that promote maintainability and reusability cannot be stressed enough.
Documentation is a deliverable that will assist developers working on future mod-
ification or reuse of a tool or component. Documentation can be created for either
source code or usability, and requires standardization just like source code.