Thursday, September 20, 2012

Things to avoid

Magic numbers, especially if they appear in more than one place. They really want to be named constants, but they also have to be named in a way that is not dependent on the actual value. For example, worldPopulation = 6,973,738,433.

Thursday, September 13, 2012

The five (5) principles

... and here they are:

  • Single responsibility!
  • Open-closed! (but watch out for: single responsibility)
  • Liskov substitution!
  • Interface segregation! (see also: single responsibility)
  • Dependency inversion!

Sunday, January 01, 2012

No ParkHelper for you

FAIL:

../../../gcc-4.6.2/libjava/include/jvm.h:795:3: error: `ParkHelper' does not name a type