I wasted a large part of Friday trying to get one line of code to execute.
I knew exactly what I wanted to do. I just couldn’t figure out the right syntax. I tried paraphrasing my problem and Googling about 20 different variations. I posted questions on forums and incessantly hit the refresh button for a reply. I tugged at my hair and frazzled my nerves. Like an obstinate buffalo on a bazaar road, that line of code got in the way of all my progress.
When my work day was done, I realized how I had nothing to show for those 6 frustrating hours. To underline this, I arrived at a more elegant solution after disconnecting from the problem over the weekend.
What just happened here? A lay person would say that I disappeared down a rabbit hole. Economists call this the sunk-cost fallacy. What both these terms have in common is the act of lowering one’s self into a pit and losing sight of the big picture.
How does one avoid this mistake? Obviously the cliche of ‘never give up’ is counter-productive here. The best solution I have come across so far is called ‘time-boxing’. The idea is to set a deadline before we start a particular task. Say I encounter a stubborn bug and I am trying to get a solution to work. I could time-box my search to 1 hour before I start. When an hour has passed, I then ought to evaluate whether to give-up, compromise or give myself an extension.
Sunk costs work like quick-sand. The deeper in we are, the lower we are likely to sink. Time-boxing allows us to step into quicksand with a rope tied to our waist.