这一章没什么好说的,需要注意的checklist里都列出来了,用的时候一条一条对着看就行了。
Checklist: Fundamental Data Types
Numbers in General
- Does the code avoid magic numbers?
- Does the code anticipate divide-by-zero errors?
- Are type conversions obvious?
- If variables with two different types are used in the same expression, will the expression be evaluated as you intend it to be?
- Does the code avoid mixed-type comparisons?
- Does the program compile with no warnings?
Integers
- Do expressions that use integer division work the way they're meant to?
- Do integer expressions avoid integer-overflow proble