/  26
 
www.idesign.net January 2008- 1 -
©2008 IDesign Inc. All rights reserved
 
C# Coding Standard
 
Guidelines and Best PracticesVersion 2.32
 
Author: Juval Lowy
www.idesign.net 
 
 
www.idesign.net January 2008- 2 -
©2008 IDesign Inc. All rights reserved
 
Table of Content
Preface............................................................................................................................3
 
1. Naming Conventions and Style..................................................................................4
 
2 Coding Practices.........................................................................................................8
 
3 Project Settings and Project Structure......................................................................15
 
4 Framework Specific Guidelines...............................................................................19
 
4.1 Data Access.......................................................................................................19
 
4.2 ASP.NET and Web Services.............................................................................19
 
4.3 Multithreading...................................................................................................20
 
4.4 Serialization.......................................................................................................22
 
4.5 Remoting...........................................................................................................22
 
4.6 Security.............................................................................................................23
 
4.7 System.Transactions..........................................................................................24
 
4.8 Enterprise Services............................................................................................25
 
5 Resources.................................................................................................................26
 
 
www.idesign.net January 2008- 3 -
©2008 IDesign Inc. All rights reserved
 
Preface
A comprehensive coding standard is essential for a successful product delivery. Thestandard helps in enforcing best practices and avoiding pitfalls, and makes knowledgedissemination across the team easier. Traditionally, coding standards are thick, laboriousdocuments, spanning hundreds of pages and detailing the rationale behind everydirective. While these are still better than no standard at all, such efforts are usuallyindigestible by the average developer. In contrast, the C# coding standard presented hereis very thin on the “why” and very detailed on the “what” and the “how.” I believe thatwhile fully understanding every insight that goes into a particular programming decisionmay require reading books and even years of experience, applying the standard shouldnot. When absorbing a new developer into your team, you should be able to simply pointhim or her at the standard and say: "Read this first." Being able to comply with a goodstandard should come before fully understanding and appreciating it—that should comeover time, with experience. The coding standard presented next captures best practices,dos and don'ts, pitfalls, guidelines, and recommendations, as well as naming conventionsand styles, project settings and structure, and framework-specific guidelines. Since I first published this standard for C# 1.1 in 2003, it has become the de-facto industry standardfor C# and .NET development.Juval LowyJanuary 2008

Share & Embed

More from this user

Recent Readcasters

Add a Comment

Characters: ...