Last week I bought a piano

Last week I bought a piano. In the 8 or so hours of time that I have invested into it so far I have already come to realise that there are a lot of parallels that can be drawn between programming and music.

For me, music always something consumed and not produced. I didn't go to a posh school, so music lessons from the ages of 11-13 consisted primarily of hitting the 'demo' button on the keyboard or making gun and helicopter noises on one of the ridiculous settings (a huge oversight on the part of whoever bought those keyboards). I liked listening to music though. In the right environment with people that actually cared, I'm sure I could've done pretty well.

who wants to slog through musical theory when you could be outside playing cricket?

I think my brother may have had a few years worth of piano lessons when he was younger. I never expressed any interest in learning as a kid so I don't blame my parents for not trying to force me into it. In fact, I thank them because it may have turned me away for good. Playing music as a kid was lame - who wanted to slog through musical theory when you could be outside playing cricket? Anyway, I was already channeling all of my inner nerd into playing chess competitions. Anything more and I may have lost the last shreds of street cred that I garnered from being able to throw tennis balls really fucking far.

By the time you get to your mid-twenties, being able to play music is suddenly incredibly cool. Everything I ever spent time learning that I thought might make me cool didn't: card tricks, diabolo, solving the Rubix Cube. In truth, that's never the reason that I learnt those things (and if that is your motivation, you'd bound to fail). Ironically, the one thing I learnt which made me nerdier is now in vogue; programming.

I like to think that I am a logical and rational person, but I've read enough books on the subject to comprehend that I am beset with irrational emotions like the rest of you. As such, my first hour or two with the piano were troublesome. I went through the gamut of emotions:

Eagerness -> Daunted -> Resilience -> Disheartened -> Helplessness -> Rationality

I knew that it wasn't going to be easy, but sitting there with 88 shiny keys staring back at you, knowing that a 4 year old can play them better than you ever will drains enthusiasm very quickly. In my attempt to rationalise, I figured out that if it takes me 20 minutes to drink a pint which costs £5, and my piano was £300, just putting in 20 hours of effort will leave me net-positive. If I haven't made much progress at that point, I can re-evaluate.

I have seen first hand that a similar progression happens with learning how to code. Most people think it's too hard and then give up before they've even started. The key is realising that programming and music are both an art and a science at the same time.

To master an art, you need to break the rules and reinvent. Sometimes you need that in science too, but science has right and wrong. Art is just art, and if it's not right, you're looking at it wrong. This is key, because it makes starting out at an art very simple - you can achieve something with very little knowledge.

Both music and programming and backed by millions of person-hours of evolution of their fundamental theories. We're left with a generally accepted, distilled version of this theory which makes learning something so complex achievable. Unfortunately, if you'd like to really learn that theory, it's going to take you a few years of full time study. We most commonly call that a degree.

I didn't learn to program at university. They tried to teach me, but I've since realised that you can only truly learn by working on a project that you're passionate about. What I did learn was a lot of solid theory that underpins most of what I do now. Plenty of people didn't study Computer Science but they're great Software Engineers. I can tell you unequivocally that if they didn't pick up that theory as they went then they wouldn't have made it to where they are. They're living proof that you can do it in reverse. This is great news for my Piano playing - I know I'm going to need to learn some theory, but I don't want to spend hundreds of hours up front learning how to read music before I play a song.

Trying to teach someone CoffeeScript as a first language would be like trying to learn the piano with the white keys painted black.

As an Engineer at Uber, I've spent the majority of my time in San Francisco, where most of Engineering is based. Due to some personal (read: visa) issues, I'm now working out of the Uber London office which houses plenty of operations colleagues, but no engineers. As a way to give back for them graciously housing and feeding me, I've decided to give something back by teaching them about Engineering.

Many engineers try and teach people to code, but most of them do a really shitty job for a variety of reasons. I think the most important quality that these people are lacking is empathy - things that we take for granted like syntax, control flow or even something as simple as a program being read top-to-bottom might need to be explained. There are so many things which have been badly designed over the years which are so unintuitive that even smart people cannot pick up without an explanation. It's why I hate CoffeeScript. Trying to teach someone CoffeeScript as a first language would be like trying to learn the piano with the white keys painted black.

I'm a firm believer in perpetual education, so armed with some brilliant articles and a couple of books on the subject, I'm going to try and design an environment to teach programming with the same methodology which I'm applying to my own learning of the piano.

There are countless "how do I learn programming" and "how do I teach programming" questions online which seem to have an astounding number of replies which lack empathy (or more likely a high amount of narcissism). As a community, we need to do better.

I have been lucky enough to have been able to mentor some of the more junior members of the team whilst at Uber. Many of these things thoughts stem from experiences in getting them up to Uber standards quickly. My attempt at teaching in London will be based upon these core principles:

1. Everyone can code, but coding is not for everyone.

Antoine de Saint-Exupery famously said “If you want to build a ship, don’t drum up the men to gather wood, divide the work, and give orders. Instead, teach them to yearn for the vast and endless sea.”. To teach someone to program, they must want to learn, they must have a passion for technology (in the broadest sense) and they must be patient and independent.

2. Achieve something fast

Just like I don't want to spend hours learning to read music before playing a song that I like, it's important to achieve something fast when writing code. Pick a small, suitable project which will solidify that yearning for the endless sea. Make them say "OK, we can do this".

3. Soft introduction to theory, by example.

It is evident that if you want to become a concert pianist, you're going to need to learn a lot of musical theory at some point. Start with a quick introduction to some theory (variable types or bits/bytes) and weed out those people who don't care. If they're turned off by the introduction (after already achieving something practical) then they aren't going to go far.

4. Pick a project with the right level of ambition

So many people decide that they want to learn to code because of some 'killer app idea'. If you let them start with "imagine an app which you could speak into and it would translate that to another language", more often than not they're going to fail before they even get the microphone working. I'm a fan on being thrown in at the deep end, but without a solid theoretical background, that might be asking a bit too much.

5. Offer guidance, but let them flourish

It's tough to strike the right balance between best practices and being too prescriptive - that's something that I still struggle with when teaching. It's important to remember that you can let people do it sub-optimally. Starting a piece of music again from the top every time you put a finger wrong isn't going to help you learn quicker. Learning from mistakes is key. Thankfully, this is much simpler in a lower pressure, non business-critical environment.

I'll let you know how it works out.

Show Comments