e
C# 3.0 语言规范
从FxCop归纳出来的一些规范建议
一、 Design(设计)
1. Abstract types should not have constructors
抽象类不应该声明构造方法
2. Assemblies should have valid strong names
程序集应该具有强名称
3. Avoid empty interfaces
避免使用空的接口
4. Avoid excessive parameters on generic types
避免在泛型类中使用过多的类型参数
5. Avoid namespaces with few types
避免让名字空间含有过少的类型
6. Avoid out parameters
避免使用 out类型的参数
7. Collections should implement generic interface
集合类应该实现泛型接口
8. Consider passing base types as parameters
尽量使用基本类型作为参数
9. Declare event handlers correctly
正确的声明事件处理器,事件处理器不应该具有返回值
10. Declare types in namespaces
应该在名字空间里面定义类型,而不是外面
11. Default parameters should not be used
不应该使用参数默认值(C#没有参数默认值)
12. Define accessors for attribute arguments
应该为特性(特性)的构造方法参数定义访问器,其名字跟构造方法参数仅首字母大小写不一样
13. Do not catch general exception types
不要捕捉普通的异常(即System.Exception)
rNbsp Is 2007 03 14 Ulocate There
C# 3.0 语言规范
-
Money&You
- CSDN博客
u Time d d Auto f f Time Auto
dNbsp Is 2007 03 14 Ulocate There
C# 3.0 语言规范
-
Money&You
- CSDN博客
i Auto