Sunday, 31 May 2015

Why programming is sometimes like painting behind a towel rail.

Standing in the shower this morning, I decided suddenly that the colour on the walls was completely wrong.

I had painted the bathroom in a cool, blue colour two years earlier and thought nothing further of it since until, trapped inside by typical bank holiday weather, I’d been painting another room in our flat. A mellow yellow. I was in the mood for yellow. 

My mind idly turned to refactoring the room. Yeah, a warmer colour would do much better beside the wood, would complement it. There was, after all, plenty of time for an indoor job, with bank holiday rain outside lashing down the window panes.

A hurdle presented itself in the form of the chrome heater that keeps the towels warm (or might do, if we ever turned it on). The bars sit a few centimeters proud of the wall, enough to slip a towel through, but barely room for a paintbrush to apply a new colour behind it. 

It occurred to me that it would be complicated and fiddly. In fact, much like making a refactor to a piece of software.

It would definitely be possible to use a mini roller, and get a reasonable way in from each side. You could probably poke a brush between the bars and have a go at the middle. You’d need to use a few techniques but I could probably get it done. You could probably do the whole thing without even turning the heater off.

And for sure, it would be easy to miss something, that would be noticed and remedied later. The wall refactor would probably have bugs

Thinking about it, the way to do it properly would be to remove the heater from the wall completely, then repaint, then replace the heater. 

As a software programmer, that approach appeals because of its simplicity. There are just three things to do, and each of them is well-defined. The alternative, working around a big obstacle piece-by-piece, using various different techniques might take less time at first, but could ultimately take longer in the end. Taking it off the wall may require some up front effort, but on the other hand, would definitely give the best finish, and the least chance of missing something.

No comments:

Post a Comment