dreadedmonkeygod . net

Workarounds

For a long time, my own idealism kept me from employing any heavyweight workarounds. I knew they were "bad" in the sense of being inelegant, but didn't give much thought to the way they propagate once introduced into a developing system. (I was an undergrad at the time, and actually having to, y'know... maintain code was still a few years away.)

Then, I started working on my parents' home network.

There was one desktop computer in the house, in my parents' home office. It had a printer. Then my mom got a computer of her own, in my sister's old bedroom. She also needed to print, so I installed a networked print server to let both computers print to the printer in the office.

So far, so good.

Then, my dad got a laptop. Woo! So the office desktop was replaced by the laptop, and all went well until the print server died.

So, since the printer (a printer/scanner/copier deal) wasn't really meant to be a networked printer anyway, I hooked it up directly to my dad's machine, and set it up as a shared printer so my mom could use it too. Problem solved.

Except that my dad went away on business for two weeks, taking his laptop with him. Which meant that my mom was once again couldn't print.

So I found myself back at my parents' house on a Sunday night, my mom urgently needing to print. I had to figure out the best way to let her print to a printer three rooms away.

And then, of course, my dad came home, and needed to print. Urgently. Ugh.

See how one workaround bred another? I couldn't get the print server working, so I used shared printing. That broke down, and suddenly the "best" solution was to move an 80-pound printer up and down the hall to connect it to whatever computer needed to print.

There seem to be a lot of programmers out there that never worked on their parents' home network, and so never learned these lessons. They never learned that workarounds may save time in the short term, but are a long term source of severe drag on the project. You're pressed for time, so you put in a workaround. Then another part of the system exposes a limitation of the workaround, and you build in another workaround, which adds time to that part of the project. A requirement change collapses your brittle arrangement of hacks, and you spend yet more time trying to prop it up. Because you've spent your time building workarounds instead of features, your project is behind schedule, and you're even more pressed for time than you were when you started. You press on, and then get a bug report. Something's not working right, and it's some kind of strange interaction between they layers of your program, and it's going to take forever to debug, because your code is a mess.

You're in the weeds, and you're not getting out without a fight. The mathmatics of the situation have tilted against you. You don't have time to fix the problem right, and doing it wrong means things only get worse. You're screwed.

When the print server died back in my parents' home office, it was absolutely the right move to hook the printer up to my dad's laptop and share it out. It solved the short-term problem while inflicting acceptable short-term compromises. But when the long-term realities re-asserted themselves, I was doubly-hosed: I have a new emergency to deal with, and the old one is still waiting to be solved. And by that time I'd spent more time working around the problems than it would have taken to solve them.

The point here, is that workarounds are short-term solutions for time-sensitive problems. They buy you time to put in a real fix, and if you waste that time, things just get worse: you have the original problem to solve, plus whatever new situation has come up.

Or, look at it this way: when faced with a limitation in your own code, you can either spend time working around that limitation (and accepting further limitations on whatever you're building), or you can spend time removing it. To me, removing the feature gets heavy, heavy preference.

Obviously, there are times when a workaround is the right way to go in the short term. Here's how to deal with that: the workaround now becomes a bug in your bug tracking system, so that everyone knows it needs to be corrected, and that work can be prioritized just like everything else.

In the end, my parents decided that my dad couldn't live without scanning capability, and that having a scanner and a network printer in the office would get too crowded. But my mom could easily accomodate a dedicated printer on her desk. So they bought another printer, and everyone's happy. And it took a grand total of two hours to research, buy, and install. I don't even want to think about how many hours I spent trying to get the qprint server working.

Post a Comment

Name:
Email (Never, ever displayed.)
URL:
Remember me next time.
Comments (Sorry, no HTML allowed. Space paragraphs with a blank line.):