10
25
2015
0

[Effective C#] Item 8: Prefer Query Syntax to Loops

像其他语言一样,C#提供了一组循环控制结构(for, while, do while, foreach),但实际上,在进行序列操作时,LINQ查询语句往往是更好的选择。

Category: 题解 | Tags: Effective C#
9
11
2015
0

[Effective C#] Item 7: Understand the Pitfalls of GetHashCode()

这是《Effective C#》中讲的唯一一个要避免写的方法。。。

Category: C#及OOP | Tags: Effective C#
9
9
2015
0

[Effective C#] Item 5: Always Provide ToString()

开学了,特别忙(浪),这一系列的博文很久没更新了。。。

Category: C#及OOP | Tags: Effective C#
8
11
2015
0

[Effective C#] Item 4: Use Conditional Attributes Instead of #if

使用Conditional特性代替#if编译指令。

其实我两个都不会用。。

Category: C#及OOP | Tags: Effective C#
8
10
2015
0

[Effective C#] Item 3: Prefer the is or as Operators to Casts

优先使用is或as操作符而不是强制类型转换。

然而我一直用强制类型转换来着……

Category: C#及OOP | Tags: Effective C#
8
9
2015
0

[Effective C#] Item 2: Prefer readonly to const

优先使用readonly而不是const。话说我在看这一章之前一直不知道C#里有readonly这个东西。。

Category: C#及OOP | Tags: Effective C#
8
6
2015
0

[Effective C#] Item 1: Use Properties Instead of Accessible Data Members

这是一个几乎所有面向对象编程书里都会谈到的话题。用C#中的属性(或在其他OO语言中使用的getter和setter方法)来包装要公开的数据成员,即所谓的数据隐藏。

Category: C#及OOP | Tags: Effective C#
8
6
2015
0

一本好书——Effective C#

最近在看Effective C#,这本书讲了改善C#程序的50个方法,感觉挺不错的。我打算对每一条都发一篇文章,加深对书中内容的理解。

Efficient C#的PDF文档

Category: C#及OOP | Tags: Effective C#

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com