What Programmers Can Learn From Pathological Gamblers

May 12, 2013

Think about how many times you’ve thought you were so close to something, that if you just kept at it for a little longer, then you’d finally succeed. Imgur

Others take the opposite approach. They belive that by continuing at the task, they could make things worse.

Imgur

How do we know when to keep working, and when to call it a day?

The Near Miss Effect

Two years ago, researchers at the Southern Illnois University published a paper in which they ran an experiment on two groups of people: those who were pathlogical gamblers, and those who gambled, but not compulsively). The experiment simulated a slot machine which had three outcomes - win, near miss, and loss. A near miss is when the slots mostly matched, except for one column. They found that:

  1. Pathological gamblers were more excited about winning than nonpathological gamblers even when there was no actual monetary reward for a win

  2. Neurologically, pathlogical gamblers saw near misses as wins, while nonpathological gamblers saw near misses as losses

Now in gambling, a near miss is in reality a loss. However, if we translate these results into a different field, then near misses might actually be very useful!

The Pathological Programmer

Let’s say you are now Joe Code Monkey. Instead of having an addiction to gambling, Joe has somehow trained himself to have an addiction to writing software. His boss wants him to write The Next Big Thing for the company. So he starts by figuring out what features are needed, then he writes all your tests(woohoo TDD!), and now he needs to write the actual software. For the purposes of this example, we can simulate a slot machine here by saying that for every feature he writes and runs against the test bench, he will get one of three results:

  1. All the tests pass
  2. Almost all tests pass
  3. All tests fail

Having become a pathological programmer, Joe get ones of those rushes that makes the hair on the back of his neck stand up not only when he finally has a 100% working feature, but he also when he ran a 80% working feature. This means that instead of calling it a day because he felt that he achieved nothing today, he keeps going and gets the entire feature done. What would previously have been an quite familiar 2am existental crisis, is now a source of inspiration to push forward!

The Downside

However, just like with being a pathological gambler, there can be harmful consequences to one’s personal life. Is spending all your time and money on your work really much better than spending all your time and money on gambling? Success may mean that your boss likes you and gives you a big raise, and of course there’s the dopamine hit, but winning also means you get a lot of money and a dopamine hit. There is a risk of becoming a workaholic, of health concerns, of losing friends and family, all for nothing. Instead of giving you a raise, your boss might do the worst thing possible by NOT firing you - meaning that you have yet another day to come back, to play the slot machine.