2018年8月11日 星期六

note for "The Art of Readable Code" - CH13 Writing Less Code


The most readable code is no code at all.
Programmer最重要的技能之一就是知道哪些code不用寫,因為寫出來就要測試&維護,越小的程式碼越容易被維護,coupling程度越低越好,最好彼此獨立,有幾個方向:
  1. Create as much generic “utility” code as possible to remove duplicated code. (See Chapter 10, Extracting Unrelated Subproblems.)
  2. Remove unused code or useless features. (See the following sidebar.)
  3. Keep your project compartmentalized into disconnected subprojects.
  4. Generally, be conscious of the “weight” of your codebase. Keep it light and nimble.

Be Familiar with the Libraries Around You

每隔一段時間應該要花一下時間,讀一下你的 standard library,目的在於能對standard library的API有概念,以便在coding時能聯想到,並大量且反覆地使用這些library。


    參考資料:
  • The Art of Readable Code



沒有留言:

張貼留言

熱門文章