Can a good programmer be ten times more productive than an
average one? It’s a common claim, but one that’s hard for many people to
believe.
I read about a psychology study where subjects had to do a series
of simple math steps—like times 6, plus 12, divide by 3, minus 4. Each subject
got a big stack of cards with a number on one side, and their job was to do the
math and write the result on the other side. Most subjects got all of the
answers right, but only a small percentage spotted the trick: all that math simply
doubles the number. (Try one!) Even after doing a whole stack of cards, most
people didn’t notice the wasted effort. Some programmers are ten times more productive, and it’s because they spot the clever
solution.
There’s a classic story about mathematician John von Neumann solving
a puzzle. In the puzzle, there are two trains going 50 miles per hour. They are
100 miles apart, heading straight towards each other. Meanwhile, a bee flies
back and forth between the trains at 75 mph. The question is: how far does the bee
travel before the trains collide and crush it? As the trains approach each
other, the bee flies a shorter and shorter distance on each trip between them.
The complicated solution is to calculate the length of each leg of the bee’s
journey, and add them all up. (It is the sum of an infinite series.) The easy
way is to notice that the trains will collide in one hour: at 75 mph, the bee
will travel 75 miles in that hour.
The story goes that when John von Neumann was asked this
question, he instantly answered: “75 miles”. The person who posed the question
said, “Very good. You know, most mathematicians don’t spot the trick, because
they get bogged down with the infinite series.” Von Neumann replied, “But I did
solve the infinite series. There’s a trick?”
Some productive programmers probably solve problems the
normal way, but do it ten times faster. They are like Von Neumann doing the infinite
series in his head. But I suspect that most highly productive programmers have a
knack for spotting a clever-and-simple approach, rather than slogging through
the obvious-but-difficult-to-implement one. For programming, this is much
better than being ten times faster. The clever-and-simple solution results in
less code, which requires less debugging, less maintenance, and it probably uses
less memory and runs faster.
These examples not only show how one programmer can be ten
times more productive than another, but they also show why it is worthwhile
spending the time to mull over a problem—maybe take walks around the block or
brainstorm with co-workers—before diving in to implement the most obvious
solution.
PS: That study on simple math was also about music. Some
subjects heard music, and some were in a quiet room. The music had only one
significant effect on performance: none of the subjects listening to music
spotted the trick.

