A beautiful analogy about coding…

It’s “music” to my ears

It’s been a crazy week*, so this post is going to be brief.

I had a great conversation earlier this week which just so happened to also be an interview. In this conversation, I was introduced to a way of thinking about coding that had never before occurred to me. It has since changed the way I approach coding, making it “click” even more.

You may know from previous posts that I am a musician. My father is a musician. Therefore, music has been a part of my life for as long as I remember. I started formally music education when I began learning the saxophone in the fifth grade. I stuck with that throughout the rest of grade and high school. I had also picked up informally the guitar and drums. I found solace, stress-relief, and just plain fun when playing an instrument. It just made sense.

Fast forward a decade plus, and here I am today beginning a career as a web developer, having a conversation with a wise gentleman who says that coding is like music.

Say what?!

I was immediately intrigued. I won’t go into all the details, but here are some of the points that completely made sense like I mentioned above, and some more I’ve thought of since. If you don’t have a music background, I apologize since this may not make sense. But for those of you who do, just take a second and think about what I learned:

  • Music has loops just like coding. They’re called codas.
  • Music has a very specific syntax: whole notes, half notes, quarter notes, eighth notes, etc.
  • Some combination of notes make up what is called a bar. Some combination of syntax make up methods, functions, classes, etc.
  • Just as there are many languages with which to code, the same goes for music: genres.
  • Stemming from that, key and time signatures allow for customization within genres, just as different coding languages tend to have libraries that allow for customization
  • Everyone has their own style of coding just as composers have distinct styles of writing music.

These are just a few of the things I remembered and could think of. But, if you know music and coding…doesn’t it just make sense!?

  • My crazy week consisted of my 39 year old brother, who thought was suffering back pain, turned out had a heart attack. The subsequent scans and tests showed that he needed emergency bypass surgery. After a very successful quadruple bypass, he is now on the road to recovery. Phew!
2017 — I’m done with you already. I can’t even! Ugh!
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.