similarities between music and programming
Programming and music are not all that different. Music and computers have been a part of my life for as long as I can remember. When I got a piano I remember buying all the piano books my mom would allow me to. I immediately rushed home and sat down to learn each song in the books. When I got my first computer in 5th grade I remember googling how much RAM and CPU it had. I wanted to learn as much as I could about this powerful machine.
In my sophomore year of high school, I took my first computer science course and that helped me realized I was interested software. The idea of creating something from just lines of codes and logic was fascinating. I enjoyed learning about the beautiful logic behind a game like Tetris. As I got more interested in programming I neglected music and didn't put as much time into it as I used to. I thought practicing the piano was just a waste of time and was only going to get in the way of me becoming a better programmer.
As a year passed and I didn't realize how much piano skills I lost. Over the summer when I got back on the piano I quickly noticed my musical ear was not as strong as it was before. I could no longer hear the difference between a perfect 4th and a perfect 5th, or notice the subtle differences between a D and D flat. This was extremely frustrating because something that came so naturally to me suddenly seemed impossible. I was determined to get my skills to where it used to be. After weeks of practicing, I didn't see much progress. I was extremely discouraged and felt that I would have to accept that I no longer will be able to play as well I used to.
While watching hundreds of tutorials online on how to code in Swift I came up with an idea. What if used the knowledge I gained from these tutorials to develop an app that would help train my musical ear. This is exactly what I did. I immediately started sketching a wireframe of my app. After hours of coding I developed an app that would play a random sequence of notes, then the user would have to type in the corresponding notes to what they heard. When I was on the subway or had some extra time I could easily open up the app on my phone and use it to help me strengthen my musical ear. In about 2 months I regained the skills I lost.
This experience helped me see the similarities between music and programming I never noticed before. Programming gives me a platform to express my ideas; in a similar way, playing the piano gives me a way to express my feelings. When playing through a song for the first I hear many errors. Similarly, when I run my program for the first time there are usually many bugs. In both of these cases, it takes patience to go through each measure or line to hear or find the error. I realized when I'm playing the piano I am also practicing my programming skills and vice versa.