Long != meaningful

Meaningful names for variables, methods, and classes go a long way to making uncommented code possible. However, meaning is not conveyed simply by length.

Continue reading “Long != meaningful”

Don’t propagate exceptions in test fixtures

Been seeing this pattern a lot today. I’m working with integration tests, which have a lot of test fixtures around to do common tasks (such as inserting data into the database). These test fixtures propagate exceptions. In many cases, they simply declare that they throw java.lang.Exception. Ouch.

Continue reading “Don’t propagate exceptions in test fixtures”

Programming by difference

I’m currently working my way through Michael Feathers Working Effectively With Legacy Code. Damn good book, BTW. Anyway, this was this section on “programming by difference” that got my thinking while reading it.

Continue reading “Programming by difference”

The Dating Game

Working with legacy code can present some, um, interesting challenges. I just hit a wonderful issue to do with dates and timezones, caused by a really piss-poor data model.

Continue reading “The Dating Game”

The importance of your user interface metaphor.

Christ Stevenson bitched about the Gnome calculator Apparently, if you enter the equation ‘2*2+2*2’, it gives an answer of 12.
Continue reading “The importance of your user interface metaphor.”

Empirical vs determinstic methodologies: a cooking analogy

A deterministic methodology is one where you lay out all the steps, then following them religiously. An empirical methodology is one where you layout guidelines, and expect people to adapt as circumstances suit.
Continue reading “Empirical vs determinstic methodologies: a cooking analogy”

Build servers are for more than just building

Using a build server (such as CruiseControl doesn’t mean developers shouldn’t run local builds (even though broken builds aren’t really as serious as a lot of people make them out to be). So this raises the question: if developers run their build locally, what’s the build server for?
Continue reading “Build servers are for more than just building”

Heavy or light: it’s all relative

On the XP mailing list a discussion has been going on recently on how a student at a presentation commented that XP seemed to be fairly heavy. Now, I know that “heavy” and “light” are rather passé terms for describing methodologies these days, but you know, the student was right – for a certain point of view. In the immortal words of Ben Kenobi, “many of the truths that we cling to depend on our point of view.”
Continue reading “Heavy or light: it’s all relative”

Never use a working template

A common feature of many IDE are templates, which greatly speed writing code. People often create their own “cut-and-paste” templates as well.

An important rule to remember here is that no template should ever “work” out of the box. This way, if (for whatever reason!) you don’t fill it in, you know it will fail fast. This helps avoid bugs that can be quite subtle: template code which fails slowly. 🙂
Continue reading “Never use a working template”