Observations on making live music and writing code

A long time ago my daughter performed a piece of harp music at a recital held at her teacher’s studio. She wasn’t playing on her own harp, and she hadn’t really learned to read the music as she was playing her song. Her teacher asked her to play a duet with her, and she reluctantly agreed.

They started playing, and at some point one of the strings on the harp made a strange noise that threw her off. She stopped playing and her teacher said, no problem, let’s pick it up again at such and such measure. Well, since she hadn’t learned the music, she couldn’t find the place and they had to start from the beginning again. This happened a couple more times. My daughter said afterwards: “That’s why I don’t like playing duets.”

This got me thinking about how making music together is a lot like writing code together.

It’s usually not too difficult play a piece of music by yourself. You’re going at your own pace and can stop and make corrections as you go. But as soon as you have another person involved, things get more complicated. You have to stay in sync somehow. One way you can do this is by following the beat of the music, and practicing until you can play together without mistakes. Another way is to improvise together in the style of great blues and jazz musicians, but it takes years and years of experience playing together to get to that level. When you have more than two people, things get even more complicated. At some point you usually need a conductor to keep it all together.

Here’s how that works when writing code:

You can write a piece of code by yourself pretty easily. You know what you want to do, and you can correct mistakes you make as you go along. But as soon as you have another person involved, things get more complicated. Now you have to agree on all kinds of stuff, and you don’t have a musical beat to help you. Who works on what? How do things interface? How do you keep the code in sync? You can’t really practice this, since most code-writing is coming up with new stuff. You can agree on a common language (patterns or idioms) to communicate, but that takes time to learn. When you have more than two people, things get even more complicated. Now you need to agree on source control procedures, more frequent synchronization and communication. At some point you usually need a technical lead to keep it all together.

How you go about doing all this when the people writing the code are not in the same physical location is quite astonishing to me.

Imagine trying to make music together when half the people are 12 hours away from you.

I bet that wouldn’t sound very good.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.