Posted on 2006-10-20 15:02
云自无心水自闲 阅读(211)
评论(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。