“If I don’t debug this graph search implementation tonight, I will be poor forever.”
I actually had that exact thought, verbatim, one night during year 2. I was up late. I felt like I was stuck; no matter what I did, I kept messing up the homework problem for one of the algorithms classes I was taking.
I was caught in the worst kind of programming vicious cycle; I would make minor changes I didn’t really understand, build, upload to the auto grader, watch in dismay as I either didn’t fix the problem or made it worse. I would repeat the process.
I let myself get stuck. I was more and more discouraged, and more and more frantic. How can this ever work? Does this mean I’m not a real programmer? Does this mean I should just quit?
There were a few things going on that, in retrospect, I should have changed immediately.
First, every “real” programmer, whatever that means, has certainly lost a few hours of his or her life to a stupid bug. It’s part of the job. (It’s not a good thing, of course, but it does come up.)
Second, life is long. The course I was taking was free. I had a job I liked. I was not out of retries yet. I could always try the course again, try the assignment again, sleep on it, whatever. Part of discouragement is thinking that any immediate failure represents complete failure. That is false. You can fail a lot (and probably will) and still do well. That is life.
I hate movie portrayals of hackers. There’s some kid who’s like twelve, and needs a shower and a haircut, who can make the world change by magically typing fast. That’s dumb. People who are good programmers study hard, learn a lot, do some work. It might not feel quite like work, because they often enjoy it so much, but it is not immediate. It might not happen in a classroom, and it might not look like the book studying that we saw in school, but everyone who’s good at something learned it somehow.
When you get discouraged, do not measure yourself against other people. That is inherently discouraging. It’s inherently discouraging because you see your own struggle, but the other person’s success. It’s like you’re measuring your worst day against their best; struggle is usually private, and success is often public.
Basically, when things are not going well, I have a few choices: I can (1) quit forever, or (2) quit for a little while, take a walk, get a good night’s sleep, and try again, or (3), press on. If you really want to do something, default to option 3, use option 2 when you need it, and never use option 1. That’s it.
I knew a guy who fixed a lot of things, like floors and sinks and whatever, and he had a good saying. Whenever a task was taking longer than he wanted, he would just say, “it can’t win” and keep working. He’s right – it’s not like the tasks you’re attempting actively oppose you. There are two outcomes: You succeed, or you quit. Notice that neither of those outcomes lies outside yourself.
So remember, when you’re discouraged, choose option 3, unless you’re really hungry or tired or your brain is full for the day, then choose 2. Don’t choose option 1.
Till next week, happy learning!