云自无心水自闲

天平山上白云泉,云自无心水自闲。何必奔冲山下去,更添波浪向人间!
posts - 288, comments - 524, trackbacks - 0, articles - 6
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

是什么促使我们进行重构?

Posted on 2006-10-20 15:02 云自无心水自闲 阅读(203) 评论(0)  编辑  收藏 所属分类: 心得体会
1. 使用添加新功能更容易
2. 提升原有代码的设计
3. 使用代码容易理解
4. 使得原来的代码不再那么令人“生厌”。

一句经典的话:

Keeping code clean is a lot like keeping a room clean. Once your room becomes a mess, it becomes harder to clean. The worse the mess becomes, the less you want to clean it. If I can keep my room clean for several weeks, continuous hygiene starts to become a habit. Unfortunately, new habits often run the risk of being compromised by old habits.

To keep code clean, we must continuously remove duplication and simplify and clarify code. We must not tolerate messes in code, and we must not backslide into bad habits. Clean code leads to better design, which leads to faster development, which leads to happy customers and programmers. Keep your code clean.


最后一句Martin Fowler的话:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand。



只有注册用户登录后才能发表评论。


网站导航: