Wednesday, March 19, 2008

Brain oozing out of ears

I've spent the last couple weeks working on a really hard problem.

It all started about six months ago. One of my coworkers wandered into my office in an absent-minded fashion, stuck some burritos in the microwave (I am the Keeper of the Microwave), and doodled some stuff on my whiteboard. He'd been thinking about a painful theoretical problem I'd brought up earlier, and he thought he had a solution. Which he did. It was awesome.

The problem was that it changes everything. It's a completely new way of representing curved surfaces. It can do everything the old method can do, but entire classes of problems simply disappear in a poof of simplicity. We wanted it yesterday, and it pretty nearly requires rewriting all of the code from scratch. Just in case you're not aware, Rewriting From Scratch is kind of the opposite of Staying In Business.

Over a couple of months, we worked out how it might be possible. We were considering some new features that were impossible in the old code anyway, and it was a great excuse. We would start on the new code, but it would have an interface between the old and the new. All the old code would remain in service, but the new tools would be added to the new side. A thick layer of conversion code would let the two sides communicate, and it would be responsible for making sure we could transition all the existing customers' models into the new style.

I spent a furious couple of weeks writing the skeleton of the new code. Everything had to be done over--data handling, saving and loading files, moving objects, undo and redo -- everything. I've already sunk several dozen days into writing the conversion layer, and there's still a good distance to go. I go home mentally exhausted pretty much every night, and it's hard to ask much more from a job than that.

3 comments:

Shana said...

Sheesh, my brain would have exploded with that kind of business. Either that or melted.

evieperkins said...

Wow. How much longer is this supposed to go on?

Adam said...

Eve, the particular brain-oozing-out-of-ears project that I'm working on right now is supposed to last for no more than another week (or perhaps two, if it doesn't go very well). The code rewrite, which I'm not doing alone, doesn't really end -- but I'm hoping to see most of the old code out of production use inside of a year.