Version 1 (modified by jazz, 15 years ago) (diff) |
---|
2009-06-10
- Six Rules for Writing Clean Code - 撰寫乾淨程式碼的六大原則
Rule #1. Use pithy comments | 原則一: 使用簡潔的註解 |
Rule #2: Assign intuitive names to variables and functions | 原則二: 給定直覺的變數/函數名稱 |
Rule #3: Make ample use of white space | 原則三: 廣泛使用空白(註:排版風格) |
Rule #4: Don't make your code unnecessarily complex | 原則四: 撰寫簡潔易懂的程式碼(例:一行更新一個變數) |
Rule #5: Be explicit | 原則五: 明白陳述條件(例: !tx_val [劣] 跟 tx_val == 0 [優]) |
Rule #6. Apply rules uniformly | 原則六: 保持一致的程式風格 |
}}}