Effective C#之Chapter 5.

  rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHelios%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CDOCUME%7E1%5CHelios%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CHelios%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">

Chapter 5. Working with the Framework

与框架一起工作

My friend and colleague Martin Shoemaker runs a great roundtable called "Do I Have to Write That .NET Code?" The answer is, hopefully, no. You should use all the tools at your disposal to avoid writing code that already exists and that you can use.

我的朋友兼同事Martin Shoemaker转来转去,不知道“我必须编写那些.Net代码吗?”我满怀期望的告诉你,答案是,不用。你应该在你所有的工作中使用所有的工具来避免编写本已存在的你可使用的代码。

The .NET Framework is a rich class library. The more you learn about the framework, the less code you need to write yourself. The framework library will do more of the work for you. This chapter shows you some common techniques to get the most out of the .NET Framework. Other items help you choose the best option when multiple choices are available in the framework. You can write your classes and algorithms to utilize what's already there instead of fighting against it. The items in this chapter reflect the algorithms and classes that developers seem intent on building for themselves when they could easily use the .NET Framework. Sometimes it's because the framework isn't exactly what you need. In those cases, I show you how to extend the core functionality. Sometimes, it's because they don't understand how the core works. Sometimes, it's because they are overly concerned with performance.

.Net框架是一个很丰富的类库。你对框架掌握的越多,你自己需要编写的代码就越少,框架库将为你做很多工作。本章向你展示了一些通用的技术,让你更好得到理解.Net框架。在框架下,当有多个选择时,一些条款帮助你选择最好的。你可以编写自己的类和算法,来利用已经存在的,而不是和它们起冲突。本章中的条款反映了一些算法和类,当程序员可以很容易的使用.Net框架时,它们却似乎要寻求自己的构建方式。对于那些情况,我将展示给你如何扩展核心功能。有时候,是因为他们不明白核心是如何工作的,有时候,是因为他们过于关注性能,所以他们才自己编写。

Even with all the tools available in the framework, too many developers would rather create their own wheels. Don't write that code especially if someone else already did.

即使框架里面有全部可用的工具,很多程序员还是可能宁愿去自己动手。不要编写那些代码,尤其是别人已经做好的那些。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值