Notes from PM-R group Code Review 6/11
November 6, 2009
In case they’re of wider interest.
- Get used to
"literal".equals(object). Get used to it. Yes, yes, blah blah blah. Just get to used to it! - Useful classes 101: there’s a generic BidiMap in the Commons-collections library, version 4.0. Hasn’t hit maven2 repo yet, but it’s released (javadocs).
- Useful classes 101: org.apache.commons.io.output.NullWriter – writes to
dev/null - Boolean unpleasantness. Don’t test
myBoolean == true, just usemyBoolean. Also remember that this: -
is a really long way of sayingif(something) { return true; } else { return false; }return something. - No Magic Numbers
- Yes, Tuples are lovely. If you really don’t want to design your way around their absence in Java, use something like the generic Pair class.