Posted on 2006-10-20 15:02
云自無心水自閑 閱讀(216)
評論(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。