Changes between Version 9 and Version 10 of CodingConventionsProposal
- Timestamp:
- 12/25/09 23:04:47 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodingConventionsProposal
v9 v10 58 58 } 59 59 }}} 60 61 === No 'f' on floats with decimals === 62 It is both redundant and unnecessary to specify the 'f' on values which already contain decimals. 63 64 Here is an example of what '''not''' to do: 65 {{{ 66 float d = 0.15f; 67 float e = 15.0f 68 }}} 69 70 Here is what you do: 71 {{{ 72 float d = 0.15; 73 float e = 3.; 74 }}} 75 76 Be sure to simply use an extra '.' (dot) for floating points that are also whole numbers. Though is may not be as readable at 4:00am as "3f", your compiler will catch it and using only the dot notation keeps the code consistent and clean.