Friday, July 01, 2005

The Joys of Refactoring

The last 24 hours have been the most frustrating I've experienced in awhile.

For the last three months, with any spare time I've had free of critical priorities, I've been working on a new application. Yesterday, around 3 PM, I finally finished it.

I danced around the office with joy and satisfaction. Of course, testing still needed to happen, but the lion's share of the design and coding was done.

Fifteen minutes later, I got an email from the designer of one of the critical libraries the application relies on. He had made some changes and wanted me to do a checkout to make sure nothing broke.

As you've probably guessed, it broke the whole thing.

Most distressing, however, was I had just released a smaller application based on this same library last week. This was broken in the test environment as well.

Fortunately, he hadn't released the changes to production yet, but for the last 7 hours we've been back and forth, fixing one thing only to break another, etc. At last, here at the end of the day, the problems with this production app are fixed, so no users should be affected... but I haven't touched the new app I've sunk all my spare time the last several months into.

In the long run, the changes will be very beneficial... I like what he's done. Except that it is not in the least backward compatible with any previous versions.

Oh well. I guess this is how programmers ensure job security: by refactoring.


chornbe said...

Hey, when you get a minute I want to chance the entire Job Engine Framework so that all worker classes are descendents of System.RandomObject.Class.

Make that happen in 20 minutes? Thanks.

Jason Clark said...

Changes that break dependant code are called rewriting, not refactoring.

And now, back to my vacation....