summary: 1. for simple constants, prefer const objects or enums to #defines.
2. for function-like macros, prefer inline functions to #defines.
- seperate line -
item3: 盡可能用 const
用 const 可以幫助 compiler 偵測出使用上的錯誤
item4: 確保 objects 在使用之前已經初始化
manually initialize objects of built-in type, because C++ only sometimes initializes them itself.
in a constructor, prefer use the member initialization list to assignment inside the body of the constructor.
List data member in the initialization list in the same order they're declared in the class.
Avoid initialization order problems across translation units by replacing non-local static objects with local static objects.