The link between music and code.

Many programmers have conducted their random samplings and collected their anecdotal data and then begged the question: Why is it that so many programmers are also musicians?

Cognitive Bias

It’s very likely we are suffering from confirmation or ingroup bias. There are plenty of programmers who don’t play an instrument, perhaps we only remember the ones who do.

According to https://www.statista.com around 11% of the US population plays a musical instrument.
The number climbs to 13% for males. The number is also higher for younger demographics with 18-24 year olds being as high as 20%. Since programmers skew both male and young it’s reasonable to think the overlap matches the overall trend.

I was unable to find any actual surveys or statistics regarding programmers and musical ability.
So to test if this is really just a bias I launched a Google Survey.

Google Survey

After a modest $10 investment and a couple of days I had 100 respondents. While 100 responses leaves a very high standard deviation, if the results fell near the 11-20% mark I’d feel safe calling this confirmation bias and moving on.

50 / 50

A full 50% of programmers who responded answered that they also play a musical instrument.

Music is Math

While I agree that music is fundamentally mathematics, most people participate in music for years before taking music theory.

Adding meaning to abstract symbols

In this well circulated blog post and research paper, it’s proposed that students who do well in programming courses are those that can create a consistent mental model when confronted with seemingly random symbols and statements.

Anyone who has learned to play music has already dealt with that challenge.

Music Staff

Sheet music consists of random symbols, but follows a set of consistent rules. This may give musicians (who often start at young age) an advantage when taking programming courses for the first time.

While we may never know what the connection between programming and music really is, I’m proud to say I am part of the group.