Effective C#

will Learn in practice;

1.Always use Properities instead of  accessible data members;

2. Prefer readonly to const;

3. Prefer the is or as operators to casts

4.use conditional attributes instead of #if

5. Always provide ToString()

6.Distinguish between value types and reference types

7.Prefer immutable atomic value types

8.Ensure that 0(zero) is a valid state for value types

9.Understand the relationships among ReferenceEquals(),static Equals(),instance Equals(),and operators ==

10.Understand the pitfalls(缺陷) of GetHashCode()

11.Prefer foreach loops

12.Perfer variable initializers to assignment statements

13.Initialize static class members with static constructors

14.Utilize(利用)  constructors chaining

15.Utilize using and try/finally for resource cleanup

16.Minimize Garbage

17.Minimize boxing and unboxing

18.Implement the standard dispose patterns

19.Prefer Defining and Implement interfaces to inheritance

20.Distinguish between implementing interfaces and overriding virtual functions

21.Express callbacks with delegates

22.Define outgoing interfaces with events

23.Avoid returning reference to internal class object

24.Prefer declarative to imperative programming 

25.Prefer serializable types

26.Implement ordering relations with IComparable and IComparer

27.Avoid IConeable

28.Avoid Conversion Operators

29.Use the new Modifier only when base class updates mandate it

30.Prefer CLS_Compliant Assemblies

31.Prefer samll,simple functions

32.Prefer smaller,cohesive assemblies

33.limit visibility of your types

34.Create Large_Grain Web APIs

35.Prefer overrides to event handlers

36.Leverage .NET runtime diagnostics

37.Use the standard configuration mechanism

38.Utilize and support  data binding

39.Use .NET validation

40.Match your collection to your needs

41.Prefer DataSets to custom structures

42.Utilize attributes to simiplify reflection

43.Don' t  overuse reflection

44. Create complete application_specific exception class

45.Prefer the strong exception guarantee

46.Minimize Interop

47.Prefer safe code

48.Learn about tools and resources

49.Prepare for C# 2.0

50.Learn about the ECMA standard

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值