Notes from PM-R group Code Review 6/11

November 6, 2009

In case they’re of wider interest.

  1. Get used to "literal".equals(object). Get used to it. Yes, yes, blah blah blah. Just get to used to it!
  2. 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).
  3. Useful classes 101: org.apache.commons.io.output.NullWriter – writes to dev/null
  4. Boolean unpleasantness. Don’t test myBoolean == true, just use myBoolean. Also remember that this: –

    if(something) {
      return true;
    }
    else {
      return false; 
    }

    is a really long way of saying return something.

  5. No Magic Numbers
  6. 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.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: