Jiao Meng

Focus on .NET component development

博客园 首页 新随笔 联系 订阅 管理

I strongly agree with this guy's comments on the performance of 'for' vs. 'foreach'. We made too much meaningless microoptimization.

In my code, I find that the most important thing for me to focus on is clarity.  Writing clear code gives me the best chance of ever getting correctness, good performance, maintainability, and flexibility for future requirements.

If I try to directly build any of those, the loss of clarity means that I lose in all of them.

Regarding your specific situation, I would write the clearest way possible, then measure the real-world performance of my app, and then optimize where it matters.

http://blogs.msdn.com/jaybaz_ms/archive/2004/12/23/331474.aspx

posted on 2004-12-24 16:51  Jiao Meng  阅读(716)  评论(0编辑  收藏  举报