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)
14. Do not declare protected members in sealed types
不要在封闭类型中定义受保护的成员
15. Do not declare static members on generic types
不要在泛型类型中使用静态成员
16. Do not declare virtual members in sealed types
不要在封闭类型中定义虚成员
17. Do not declare visible instance fields
不要定义可见的(public/internal)实例域变量
18. Do not expose generic lists
不要直接暴露范型表
19. Do not hide base class methods
不要隐藏(使用或者不使用new)基类的方法
20. Do not nest generic types in member signatures
不要在成员的签名(参数或者返回值)中嵌套泛型类
21. Do not override operator equals on reference types
不要在引用类型中重载==操作符
22. Do not pass types by reference
不要使用引用(ref or out)传递类型
aRemot Pl Lv Ka Noklut Lidz Eiropas Kustibai Latvija
C# 3.0 语言规范
-
Money&You
- CSDN博客
Remot Pl Lv Ka Noklut Lidz Eiropas Kustibai Latvijac g Gorgeous Hot Babes
zRemot Pl Lv Ka Noklut Lidz Eiropas Kustibai Latvija
C# 3.0 语言规范
-
Money&You
- CSDN博客
Remot Pl Lv Ka Noklut Lidz Eiropas Kustibai Latvijar Babes Babes r Gorgeous Babes