C#编码规范简介

晨曦之光 发布于 2012/03/09 14:13
阅读 878
收藏 0
本博客( http://blog.csdn.net/livelylittlefish )贴出作者(三二一、小鱼)相关研究、学习内容所做的笔记,欢迎广大朋友指正!
                                      
                                      

C# 编码规范

                                      
                                      
最近公司为了让软件产品的可维护性更好,要建立一套编码规范,在收集了网络上的资料后,整理如下,贴上来,供朋友们参考。敬请指正。
                                      
                                    

1. Microsoft 编码规范

                                      
                                      
请参考: http://msdn.microsoft.com/en-us/library/czefa0ke.aspx
                                       
                                      
Microsoft还提供了一个工具fxcop,用来检查代码的规范性:
http://code.msdn.microsoft.com/codeanalysis
fxcop下载地址:http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=553
                             http://www.microsoft.com/downloads/details.aspx?familyid=3389F7E4-0E55-4A4D-BC74-4AEABB17997B&displaylang=en
                                      
fxcop: a code analysis tool for .NET managed assemblies
                                      
FxCop is a code analysis tool that checks .NET managed code assemblies for conformance to the Microsoft .NET Framework Design Guidelines. It uses MSIL parsing, and callgraph analysis to inspect assemblies for more than 200 defects in the following areas:
                                      
Library design Globalization Naming conventions Performance Interoperability and portability Security Usage
                                      
FxCop includes both GUI and command line versions of the tool and supports analyzing .NET 1.x, .NET 2.0 and .NET 3.x components.
                                      
                                      

2. SharpDevelop编码规范

                                      
请参考: www.icSharpCode.net
规范下载地址: http://www.icsharpcode.net/TechNotes/SharpDevelopCodingStyle03.pdf
                                      
#develop (short for SharpDevelop) is a free IDE for C#, VB.NET and Boo projects on Microsoft's .NET platform. It is open-source, and you can download both sourcecode and executables from this site.
                                      
该工具中还集成了以下内容:    NUnit:.net的单元测试工具    NDoc :.net自动源代码生成文档的工具    NProf :性能监测和优化工具
                                      
                                      

3. IDesign编码规范

                                      
                                      
请参考: http://www.idesign.net
规范下载地址: http://www.idesign.net/idesign/download/IDesign%20CSharp%20Coding%20Standard.zip
                                      
IDesign’s goal is to affect a change on the software industry, to help it mature into a modern engineering discipline. We focus solely on the design and architecture phases of development. As such we are unique in the market. Software design today (if practiced at all) is still practiced as a craft, rather than a repeatable engineering methodology, in spite of  the availability of an established well-known body of knowledge and design patterns. IDesign managed to literally mechanize the act of designing software systems. Design is not time consuming or even expensive, but done poorly it has drastic detrimental effect on the overall cost, time to market, maintainability, extensibility, quality, and even the developers morale and turnover rate. Using an analogy from the civil engineering industry, IDesign is really the engineering company that provides the building’s blueprints. While designing a building can be done in weeks, constructing it may take a couple of years. The same is true with software design: our engagements are relatively short, as little as two to five dedicated, effective days, where we analyze the requirements and produce the design.                                        
                                      
                                      

4.Philips Medical System编码规范

                                      
                                      
请参考:http://www.tiobe.com
规范下载地址: http://www.tiobe.com/standards/gemrcsharpcs.pdf
                                      
This coding standard for the C# language is mandatory for PMS. The objective of this coding standard is to have a positive effect on:
                                      
Avoidance of errors/bugs, especially the hard-to-find ones.
Maintainability, by promoting some proven design principles.
Maintainability, by requiring or recommending a certain unity of style.
Performance, by dissuading wasteful practices.
Rules and recommendations are given that promote reliability and maintainability.
                                                        
                                      

其他资源连接:

                                      
C#编程指南: http://msdn.microsoft.com/zh-cn/library/67ef8sbd.aspx
C#语言规范: http://msdn.microsoft.com/en-us/library/aa645596(VS.71).aspx  (英文版)
                        http://msdn.microsoft.com/zh-cn/library/ms228593.aspx  (中文版)
                       Visual Studio 2005 安装目录下的 VC#/Specifications/2052/ 目录中
                       Visual Studio 2008 安装目录下的 VC#/Specifications/1033/ 目录中
                                      
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=336

原文链接: http://blog.csdn.net/livelylittlefish/article/details/2543444
加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部