Code yourself a cliffhanger
Last night I was dying to do a deploy. I had worked furiously all day on a new feature, hacked it together with tests, all but one of which was passing. The tiny devil on my shoulder was goading me on, telling me I could finish and deploy in 10 minutes, but the angel on the other side knew it could take hours and told me to go home and sleep.
The angel won. And I am glad. Because I woke up this morning with a fresh mind and more importantly: an obvious place to dive in and get something done.
I coded myself a cliffhanger.
Years ago, I was slowly working through the spy show Alias on DVD. Every episode ended with the protagonist (Professional Badass Sydney Bristow) dangling from some ledge, captured by terrorists, about to drink a glass of poison, etc. All good T.V. leaves you wanting more, but Alias made me want to throw things at the TV screen:
“I just want to go to sleep, you piece of shit, but you’re suckering me into watching another episode!”
Since I had entire seasons on DVD I would get sucked into watching for hours. Eventually, I learned to just watch one episode, plus the first five minutes of the one after it. It allowed me to go about my life with peace, without any nagging worries about Sydney Bristow.
And that’s how I’ve typically coded. I work until a “good stopping point”.
But as a consequence of tying up those loose ends before quittin’ time, I often feel lost when I sit down to work the next day. So maybe I’ll try making a habit of coding up to a climax and just walking away…
Code m’self some cliffhangers.
Until next week’s episode….
–
Erik Pukinskis made SproutRobot, a web site that tells you when and how to plant a garden without making you get a Ph.D. in Gardenology first.







This is good advice. I worked with Pivotal Labs for a time and they would do this on purpose every day.
This is one nice side effect of practicing TDD — you can deliberately leave one failing test when you stop. I often find that that engages my curiosity just enough that I’m willing to dive right in without “settling in” first (read: checking email, catching up on blogs, loading a dozen interesting tabs from Hacker News, and, oh, look, now I need to get up and use the bathroom).
Sometimes if I don’t have an actually-failing test, I’ll just do this:
def test_some_feature
flunk ‘Write me!’
end
Sam: I love it. Great idea.
Nice post! I had not considered this as a productivity tool before, but will certainly be using it now.