21 December 2005

Exception messages

I've been spending a lot of time working on legacy code lately and apart from everything else, the thing that sticks out is good exception handling. Doing this has firmed my belief in handling exceptions as close to the source as possible (or alternatively where you have the most context) and wrapping them in RuntimeExceptions (or subclasses of). It also highlights the importance of placing decent messages into exceptions. The usual "Cannot do X" is next to useless. In our bookings engine you have all sorts of good context, booking numbers, flight details, site codes, etc. that allow you to track down problems in code that a stack trace doesn't always allow.

What prompted this post was the above image from TheServerSide.com with a wonderful message.

15 December 2005

Software Quality

I've been meaning to write about the cost of writing software for a while (unfortunately it's sitting as a draft), but the recent Tokyo Stock Exchange fiasco highlights the true cost of not making the effort to write software correctly. When will people (i.e. the management with the money bags) learn that the cost of maintenance and also mistakes are orders of magnitude higher than the costs of doing it properly the first time (and doing it once). Creating quality software is not rocket science, there are well known methods for doing this. What I find amazing is how many organisations baulk at paying slightly more initially, but will happily pay bucket loads down the track.