[Journal - Logic]

Logic

Saturday, July 31, 2004

Suppose you've got the following tasks to accomplish:

  1. Prepare breakfast.
  2. Change the oil in your car.

You could go about it as follows:

  1. Slice some bread, push a slice of bread under the car, and let out the oil to soak the slice with it.
  2. Open a bag of cereal, and fill its contents into the fuel tank.

That's about the same level of logic I found in a piece of code I reviewed the other day. An OO kid going berserk. The problem is, one can write lots of classes and packages that don't make any sense whatsoever, and the compiler won't complain. My analogy may be on the brink of inanity, but in software, anything seems possible.

When designing software, be straightforward, keep it simple, do what's necessary. Don't fuel your car with cereal.

My car, on the other hand, runs on nothin' but pure XML.