Resource Page DescriptionThis document covers many aspects of programming with C#, from naming, structural and formatting conventions to best practices for using existing and developing new code.
Background It's the manual developed at
Encodo Systems AG for developing with C# and .NET, but many of the concepts and ideas can be applied to any programming language. The intent of this document is not to codify current practice at Encodo as it stands at the time of writing; instead, this handbook has the following aims:
- To maximize readability and maintainability by prescribing a unified style.
- To maximize efficiency with logical, easy-to-understand and justifiable rules that balance code safety with ease-of-use.
- To maximize the usefulness of code-completion tools and accommodate IDE- or framework-generated code.
- To prevent errors and bugs (especially hard-to-find ones) by minimizing complexity and applying proven design principles.
- To improve performance and reliability with a list of best practices.
Wherever possible, however, the guidelines include a specific justification for each design choice. Unjustified guidelines must be either justified or removed.
Whereas the Encodo Handbook draws mostly on in-house programming experience, it also includes ideas from Microsoft’s
Internal Coding Guidelines and
Design Guidelines for Developing Class Libraries and benefits as well from both the
IDesign and
Philips coding styles as corroborative sources.
Using the Handbook This handbook mixes recommendations for programming with C#, .NET and the Encodo libraries (code samples draw from these libraries, but access to them is not required). It includes rules for document layout (like whitespace and element placement) as well as design guidelines for elements and best practices for their use. It also assumes that you are using Microsoft Visual Studio 2005 or newer.
This document is a work-in-progress and covers only those issues that Encodo has encountered and codifies only that which Encodo has put into practice and with which Encodo has experience. Therefore, some elements of style and design as well as some implicit best practices are probably not yet documented. Speak up if you think there is something missing.