Is it just me, or have other people noticed that software engineers are also often musicians, or at least, huge lovers of music? In my work and studies over the years, I’ve found music-making and coding use the same kind of thinking. In the following article, I’ll explain music from the perspective of computer programming using a common language, and hopefully, I’ll be able to illuminate similarities between these arguably disparate disciplines.
To start, I think the main way music and coding are similar is that at their heart, they’re both forms of state management. To explain this connection, let’s start with an example.
Let the Music Play
Begin by imagining the melody to your favorite song. If you can’t remember one, think about Fur Elise by Beethoven. Specifically, think about the opening trill between E and D# that opens the song’s first phrase. If you can’t remember Fur Elise, think about Hot Cross Buns” or “Row Row Row Your Boat.” Hear the melody in your head and try to be aware of your feelings as you sing through it. Specifically