Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Coding Standard and Code Review

Coding Standard and Code Review

Scheduled Pinned Locked Moved C#
csharpquestioncode-review
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael P Butler
    wrote on last edited by
    #1

    Anybody got around to putting a Coding Standard together for C# code, that can be used in code reviews. I'd like put one together but I've not written a lot of C# code yet. Does everybody write their code in the style of the MS samples? Michael :-)

    J K 2 Replies Last reply
    0
    • M Michael P Butler

      Anybody got around to putting a Coding Standard together for C# code, that can be used in code reviews. I'd like put one together but I've not written a lot of C# code yet. Does everybody write their code in the style of the MS samples? Michael :-)

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      The style of the MS samples is what MS proposes as the standard (of course). The only change I've made that I'm aware of is I prefix private variables with _. I stick to one public class or public struct per file, excluding structs created for P/Invoke. If an enum is only used by a class/struct I stick it in the same file at the bottom of the file. Some say I should make an enum part of the class if it is only used by that one class -- public class foo { public enum bar { ... } ... } -- but I like it being separate so if a later piece of code needs it I don't have to change all references to the typename. Take my standards with a grain of salt though, I'm the only person reading (most of) my source :-P James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

      1 Reply Last reply
      0
      • M Michael P Butler

        Anybody got around to putting a Coding Standard together for C# code, that can be used in code reviews. I'd like put one together but I've not written a lot of C# code yet. Does everybody write their code in the style of the MS samples? Michael :-)

        K Offline
        K Offline
        Kevin McFarlane
        wrote on last edited by
        #3

        Well, you can use the official .Net Design Guidelines as a starting-point. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnetframeworkdesignguidelines.asp Kevin

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups