Slashdot Mirror


Coding Standards for C#?

infinite9 asks: "I've been given the task of writing the coding standards for my corporation. I've been in IT for 12 years, so many things are obvious. Recently though, my employer has standardized on C# and .NET, and since I'm new to the technology (isn't everyone?) I'm not sure what to include. I've included a paragraph about signing assemblies with a standard key pair as well as a few other odds and ends. Apart from the obvious statements that apply to any language like good comments, good variable names, and maintainable code, can anyone suggest other C#/.NET related things that I should include?"

4 of 82 comments (clear)

  1. C# Coding Standards by cymantic · · Score: 4, Informative

    To work out some standards use what you know from Java, Python or any other language with a C based syntax.

    The guys at ICSharpCode (http://www.icsharpcode.net/TechNotes/) have some nice documents on coding styles/standards for coding for #Develop (you don't have to follow them when coding using #Develop)

    Also have a look at something like FX Cop from MS (http://www.gotdotnet.com/team/libraries) to help enforce coding standards.

    t

  2. Reasonable, my twopennyworth by Burb · · Score: 3, Informative
    This is pretty sensible advice. Most C# shops I've worked in stick to the standard MS coding conventions.

    I would also stress: use the inline documentation stuff a log (/// comments). Use NDOC to generate documents from the XML output. Make use of the using() {} statement to encourage early resource disposal.

    --

  3. MS design guidelines by Jussi+K.+Kojootti · · Score: 4, Informative
    Yep, They're not bad: Design Guidelines for Class Library Developers.

    Maybe you'll find this useful: White paper on resource management in components written for the Common Language Runtime (CLR).

    -jk

  4. In addition to the coding standards pointed by... by Utopia · · Score: 3, Informative


    ....several other readers. Take a look at FxCop.
    It will help you check your code for conformance to design guidelines and point out possible usage errors, localization issues, security problems, and possible performance improvements.