What learning to play the piano reminded me about software engineering

A couple of months ago I decided I wanted to learn a bit more about music so I decided to learn how to play the piano. This is an entirely new world for me, as I have practically zero prior knowledge. Little did I know then of how similar my experience was going to be to when I started writing code!

Reminder #1: You think of the Matrix but you can’t type yet

Well the Matrix was not out when I started coding but you get the picture. You start off thinking that you are going to soon be entering the Matrix, heck you might even create Matrix all on your own 🚀… But the reality is you don’t really yet know how to touch type all of those weird symbols that you need !#,%,^,&&,(),[], {}, / … let alone match them together in a way that works.

It’s the same experience with the piano, you’ve seen some videos online of people playing all these amazing pieces and you are thinking, “Yes that would be really cool” but the reality is you don’t know what’s the difference between the blacks and the whites yet! So, you realize that it’s not that easy as other people make it look but you are determined to not let that stop you 💪!

Reminder #2: Start from the basics

By now you know that you need to start from the basics and that you need help! You’ve gone off and you have found a tutor, a course, a book, a friend who is willing to help or a combination of all of the above 🙂.

You are starting to learn a programming language and you come across your first for loop. It’s impressive how much I had forgotten about writing my first for loop. It feels like second nature now but thinking back it’s such an odd thing to write. Not to mention all the effort it took to get it right for the first time, make sure it runs and it prints that magical sequence going from 0 to 10!

It’s the same with the piano. Learning where to put your hand on this endless, it seems, series of keys, reading your first notes with all of those stems and circles and playing something that seems to have some melody to it (even it is just going from C to G) is such a wonderful experience!

And now you have reached the point where you know the building blocks of your craft. You know your ifs from your fors and your blacks from your whites – surely you are all set right ?

Reminder #3: Practice makes perfect

In programming it’s almost expected that you won’t find the optimal solution on your first attempt. If you write the same piece of code 100 times it’s never going to look exactly the same: maybe the variable names are not as descriptive, maybe this function does not belong in this package, maybe you have not tested this as thoroughly as you should have, maybe this is better in a library somewhere rather than here …

And for music, oh well – that’s exactly the same but for different reasons. Maybe you were too hasty or too slow, maybe you missed a half note here and there, or even pressed a couple of extra ones just because your fingers were not in the right place 😄.

And so … you repeat and repeat and repeat

Putting it all together

Like playing the piano, writing code is a form of art. It takes a lot of effort to produce something and takes learning from many other people before you can set off on your own but it’s totally worth it!

And yes, you do need to practice and practice but it’s not just the hours or the repetition that makes you better. It’s your thought process, attention to details and your willingness to fail a million times before getting it right that makes you master your craft.

Leave a Reply