fishing and refactoring: A story with two endings

The Happy Ending

I'm salmon fishing on the River Spey, on the beautiful Tulchan beat, concentrating on spey casting. My phone is back at the hotel. My laptop is back at the hotel. I'm not thinking about coding. I'm fishing and I'm only fishing. Suddenly, from "nowhere" my subconcious pops an idea up into my consciousness. It says, hey, you know that code you were working on 2 weeks ago...? Where you had that nagging feeling there was a better, simpler solution? I know you know what I'm talking about! We'll I've been working on that for you. And I've come up with this. Here's the idea. Tada. What do you think?

For a moment, I think about the idea. It seems a good one. Of course, I can't try it out now because I'm waist deep in the middle of the River Spey. I promise myself I'll look into it when I get back to the hotel. I carry on trying to catch a salmon.

Later, back at the hotel I try out the new idea. I re-run all the unit tests and they pass. I make the change.

A few weeks later I'm fishing again. This time on the River Tay at Dunkeld. My subconscious pops up a new idea. I make a note of it. In the evening, back at the hotel I try the change. All the tests pass. The change is live.

A few weeks later I'm fishing again. On the River Verdal in Norway. My subconscious pops up with another new idea...


The Sad Ending

I'm salmon fishing on the River Spey, on the beautiful Tulchan beat, concentrating on spey casting. My phone is back at the hotel. My laptop is back at the hotel. I'm not thinking about coding. I'm fishing and I'm only fishing. Suddenly, from "nowhere" my subconcious pops an idea up into my consciousness. It says, hey, you know that code you were working on 2 weeks ago...? Where you had that nagging feeling there was a better, simpler solution? I know you know what I'm talking about! We'll I've been working on that for you. And I've come up with this. Here's the idea. Tada. What do you think?

For a moment, I think about the idea. It seems a good one. Of course, I can't try it out now because I'm waist deep in the middle of the River Spey. I promise myself I'll look into it when I get back to the hotel. I carry on trying to catch a salmon.

Later, back at the hotel I think about the new idea. I'm wary of making the change. There are no unit-tests I can quickly run. I'm remembering a few months back - that time when I tried an idea and broke stuff and was castigated. I'm fearful of making the change. I don't make it.

A few weeks later I'm fishing again. This time on the River Tay at Dunkeld. My subconscious gives me a new idea. I make a note of it. In the evening, back at the hotel I think about making the change. There are still no unit-tests. And I'm still remembering that time a few months back - when I tried an idea and broke stuff. Boy was I ridiculed. And if anything the culture is a bit worse since then. I can feel the fear. Once again I decide not to make the change.

A few weeks later I'm fishing again. On the River Verdal in Norway. This time, my subconscious doesn't pop up a new idea.

No comments:

Post a Comment