Computer programmers are an interesting kind of lazy. We have little tolerance for tedious work and, as a result of this, are willing to spend hours writing code to automate it .
This laziness can make debugging a program difficult. When you are intimately familiar with code which is misbehaving, you tend to continue to make the same assumptions you originally made when you wrote the code. In this way, each time you read it, you cannot see its mistake.
This is why in the 6 Stages of Debugging , the programmer goes from “That can’t happen.” to “How did the code ever work?”
It’s like the riddle:
There’s a one story house. Everything in the house is blue. The walls are blue. The floor is blue. The furniture is blue. The door is blue. What color are the stairs?
If you read it quickly, you cannot see why “blue” is the wrong answer. If you slow down and read every word, the answer is immediately apparent. There are no stairs.
Talk to the Duck
To combat this problem, the graduation or new hire gift to new computer programmers is frequently a rubber duck.
When you are debugging, you explain how your code works to the duck. You treat the duck as someone who doesn’t know anything about your code and explain each step of the process in detail. At some point, the act of explaining your code to the duck reveals the problem.
This little trick that computer programmers know is a life lesson for us all. The act of slowing down and explaining life’s problems and dilemmas can normally solve them.
I have a personal boycott of flying because of the Transportation Security Administration (TSA). No volume of examples of abuse seems sufficient to rouse public opinion, so I have decided to vote with my dollars and avoid flying altogether. This personal boycott of mine makes traveling obviously difficult.
The first time I tried to plan a trip after starting my boycott, I had to research all the options. What is the cost in time and money to drive, bus, train, boat, and chauffeur long distances. Each one required detailed research to understand. After doing all that research, I had a debugging problem. I couldn’t see the solution because I was so familiar with the options. After days of no progress, I realized that I needed to talk to the duck.
Starting from the beginning and talking through the options made me move slowly enough to discern what was most important to me for the trip. I was able to create the mental flow chart for choosing the right transportation for each trip.
Complain to the Duck
Sometimes in life, you aren’t ready to explain the problem to the duck. First, you need to vent a bit.
Recently, I was trying to make Thai Fried Rice for dinner. I had already chopped the cucumber and went to open the pork only to find out that it was already expired. What is more, it had expired the day after I brought it home from the grocery store.
I was immediately overcome with two present problems. First, I needed to figure out what I was going to make for dinner now. Second, I was upset and needed to calm down.
Bottling up my feelings and trying to think of a solution to my strategic problem wasn’t effective. Instead of finding a solution, my mind would cycle back to my feelings with regret, blame, and sadness escalating. “Why didn’t I look at the expiration before I bought it?” “This is the grocery store’s fault.” “I’m never going to be able to make dinner now.”
Again, the duck provides a solution. I can complain to the duck.
As Barbara Scher explains in Wishcraft (excerpts from Chapter 5, pgs. 92-97):
Half the time, when you say, “I can’t,” or “It’s impossible,” or “I don’t have this or that,” all you’re really trying to do is something very natural and healthy that has been forbidden by our culture.
You’re trying to complain.
…I happen to believe in the efficacy of complaining the way some people believe in the efficacy of prayer. It’s good for you. There are lots of times when you need it.
…A lot of times when you start reciting all the reasons why you can’t get your goal, it’s not because you really think you can’t. It’s because you’d really just as soon not. It’s because you sort of hope you won’t have to.
What you really are is scared.
… So what do you do? You do what every actress worth her salt does before she goes out on stage on opening night: you have a fit. You kick, stomp, and cry, “The lights are ghastly, the lines are awful, the playwright should be shot, the director’s an idiot — I’m not ready, I cannot go on, I will not go on, I’m leaving!” And then you walk onstage under those lights … and you’re fine.
…You can try it right now, in the privacy of your own mind. …Say anything, as long as it’s a mean, miserable complaint with some punch to it.
Did you notice that your energy level went up? Does your goal suddenly look a little less impossible? You haven’t solved anything yet. The strategic problem is still there. Your doubts are still there. So why are you laughing?
…we’ve forgotten something every 2-year-old knows: how good it is for us to throw a tantrum.
I warned my nearby family that I needed to complain and then I complained. I complained about the expired meat, the size and typeface of the expiration date, the grocery store’s quality control, the fact I had already cut the cucumber, the recipe itself, the fact that it is my chore to make dinner, and more.
At some point in my complaining, I interrupted myself with an idea: I could pack up the cucumber in a storage container and make omelettes for dinner. And that was that.
Pretend It is the Duck’s Problem
Humans are very good at helping one another. Barbara Sher makes this point in her TEDxPrague talk “Isolation is the dream-killer, not your attitude.” She explains near the end of her talk:
So here’s what you do: You get a team. You figure out what you want, and then you say, “Here is my wish, and here is my obstacle. Here’s what I want, and here is why I cannot have it.”
If you don’t say both those things, nothing happens. We are problem-solving animals. If you say, “I’d love to be a ballerina.” Everybody goes, “Mmm.”
If you say “I’d love to be a ballerina, but I’m 44 years old.” Every mind starts working.
…Even if people don’t like you, they’ll solve your problem.
My own problems can seem insurmountable. When they do, I write them out, explaining what I want and why I cannot seem to have it. Then I read back what I wrote, pretending the problem is someone else’s. Inevitably, I immediately think, “Oh, she should just…”
My first solution is not often complete, but the brainstorming process has begun and in a bit of time, I will have solved “the Duck’s problem.”