Microsoft Coding Standard Document

后端 未结 6 1526
囚心锁ツ
囚心锁ツ 2021-02-04 11:35

Is there a Coding Standard document available for download from Microsoft ? I want to use their standards, mainly for C#.

相关标签:
6条回答
  • 2021-02-04 11:48

    If you wants guidelines published by Microsoft, google them or use links in other answers.

    But if you want "standards used in Microsoft's own code" - there isn't a single answer. Microsoft is a big company with many divisions and acquired code, so each project or product has it's own style.

    Even style of .NET Framework itself is slightly different from what StyleCop suggests.

    My point is, paying more attention to those guidelines and white papers than Microsoft itself does might be not be a good idea.

    0 讨论(0)
  • 2021-02-04 11:59

    If you're using C#, you can learn Microsoft's preferred style as you code by running StyleCop on any code that you write. It's a lot easier to learn that way than trying to absorb some huge document.

    0 讨论(0)
  • 2021-02-04 12:05

    The patterns & practices Guidance Explorer

    "is a tool that enables discovery, composition and consumption of high quality development guidance. Guidance Explorer installs with a connection to the patterns & practices guidance library including performance and security topics for .NET, ASP.NET, and ADO.NET applications. The guidance library contains a variety of guidance types including checklists and guidelines covering design, implementation and deployment topics."

    So, this will be a bit friendlier than one big document and will let you:

    • Find relevant patterns & practices guidance
    • Build customized checklists for your development scenarios
    • Build customized guidelines for your development scenarios
    • You can build custom sets of guidance and share with your team as recommended practice.
    • Subscribe to an RSS feed of guidance

    alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=guidanceExplorer&DownloadId=25389

    0 讨论(0)
  • 2021-02-04 12:07

    Also look at Microsoft Developer Center: Patterns and Practices, though some of that is more high-level than just coding standards.

    0 讨论(0)
  • 2021-02-04 12:10

    MSDN is a great place to start a search for anything related to programming on Windows. You can start with:

    • Coding Style Conventions
    • Coding Techniques and Programming Practices

    Remember there is no one size that fits all and conventions/standards change from team-to-team, language being used etc.

    0 讨论(0)
  • 2021-02-04 12:11

    Design Guidelines for Class Library Developers

    Naming Guidelines

    0 讨论(0)
提交回复
热议问题