Paying Back Code Debt Has Value

April 5th, 2006

Most code bases have some kind of code debt associated with them, legacy code bases tend to have lots of code debt. The good news is, paying back that code debt isn't a complete time sink - it has definite advantages too. Obviously, reducing code debt tends to make the team go faster, but it also tends to fix bugs.

Quite often where there is debt, there is not just a lack of maintainability but actual bugs that are frustrating your users. By cleaning up the code, you will often fix those bugs without any special effort to do so - it just happens because of the simplified design.

The other thing that I'm noticing about areas of code that have heavy debt, is that the debt is usually caused by a lack of understanding when the code was written. As such, by taking the time to clean up the code, you tend to learn how to work with that area and suddenly things that were impossible because fairly trivial.

As an example, the end of Swing text documents has some very unusual properties - the document is actually one character longer that it's content claims. The last character is a magical new line that suffice it to say, "makes stuff work". I have no idea why that last character isn't reported, but it's not. Since the last block element in the document actually ends on that character, if you want to remove that block element you need to do some fancy footwork, since you can't remove the last character. We've seen various bug reports come in about people not being able to remove the last table, list, div or whatever at the end of the document for quite some time.  Today while paying back some code debt to clear the way for a new feature, I came across our nasty mess of work-arounds for the end of the document and took the time to clean up the code. The result is about a hundred lines shorter and should fix the vast majority of end of document problems, including a whole bunch we're yet to discover. Paying back our code debt has made our editor better for users.

It's really important though that you don't just pay back code debt - you need to keep adding features to keep your product alive and sales going forward too. It's not just a financial benefit though, if your engineers are spending all their time fixing the bad spots in your code, morale tends to go through the floor and you just stop caring. If you can mix in some debt repayments with interesting new features the team stays focussed and does better work. It's a form of sustainable pace - what you work on is as important as how much you're working.

USA To Be Towed Across International Date Line

April 2nd, 2006

In an effort to reduce the ridiculous amount of time wasted on April Fools day, the USA will be separated from Canada and Mexico and towed westward across the international date line, thus making April fools day start first in the US and letting them post all the pointless drivel to the internet prior to the rest of the world waking up. With the current location of the US, Australians have to put up not only with 24 hours of their own stupid April fools jokes but with an extra 12-16 hours of the US's jokes the next morning.

Canada, keen to be rid of their limelight-hogging southern neighbors, has already signed onto the deal. Mexico and Australia however have raised concerns about the plan. Mexico claims that it will be devastating to it's people smuggling industry, however the Canadians are suggesting that people would be willing to pay more to be smuggled over the new ocean into Canada. Australia's concerns revolve around being forced to accept the noisy Americans into the pacific neighborhood. Plans are already afoot to move New Zealand north and easy to act as a make-shift fence between the Australians and their new neighbors. The plan gaining heavy support mostly due to the extra distance it would place between the Australians and all those sheep loving, kiwi folk.

While some have expressed concerns about the environmental impact of moving significant parts of the earth's tectonic plates into a new hemisphere, this isn't the first time such a move has been made. In 2002, Australia went on a drunken rampage through the panama canal and woke up in the North Atlantic. Eventually they were driven to return to their usual geographic location by the constant whining of the poms who were now only a few hundred miles to the north-west.

It's not April 1st, this is not a joke.

How To Block Annoying Referrer Spammers?

April 1st, 2006

There's a very persistent (and very stupid) referrer spammer pummelling my blog and I'm getting sick of it - not least of all because at one point it actually managed to completely overwhelm the tiny little virtual server my blog runs on so that nothing else could access it. Given that I'm using WordPress with Apache, what's the easiest way to block it?

Java On Linux - Still A Disaster

April 1st, 2006

Someone really needs to sort this out once and for all. It's pretty simple to get Java installed so that you can run it - getting it installed so that the packaging system is satisfied that it's there involves various bits of voodoo and integrating it so that you can use applets in Firefox is still a pain. Can we just decide on a standard location for the plugin file so that it can be auto-installed, or maybe even just a standard config file that tells the JRE installer where the Firefox plugin directory is?

Of course, none of this would help me since Sun decided not to include the plugin with the AMD64 build of the JRE. Why the heck not?

Sigh.