
有效的學習方法-實作
什麼是像專家一樣生活?
你需要事先了解的事
- Good code is well-organized. Data and operations in classes fit together. There aren’t extraneous dependencies between classes. It does not look like “spaghetti.” (良好的結構)
- Good code comments explain why things are done not what is done. The code itself explains what is done. The need for comments should be minimal..(最好用code來表達,而不是靠註解。)
- Good code uses meaningful naming conventions for all but the most transient of objects. the name of something is informative about when and how to use the object.(好的命名規則)
- Good code is well-tested. Tests serve as an executable specification of the code and examples of its use.(經過反覆測試的考驗)
- Good code is not “clever”. It does things in straightforward, obvious ways.(好的code易於瞭解、表達明確,而不一定要看起來好棒棒)
- Good code is developed in small, easy to read units of computation. These units are reused throughout the code.(unit可重複性高、易於使用、不要太肥大)
小結