previous |
start
.... [Slide 53] ....
Programming Style: Miscellaneous
- Spaces around operators, after keywords, but not after method
names
Good: if (x > Math.sqrt(y))
Bad: if(x>Math.sqrt (y))
- Don't use C-style arrays:
Good: int[] numbers
Bad: int numbers[]
- No magic numbers
Good: h = HASH_MULTIPLIER * h + val[off];
Bad: h = 31 * h + val[off];
previous |
start
.... [Slide 53] ....