← Journal

·Process

Writing code and playing music — the same thing

Why being a programmer and a guitarist is not a coincidence — and what each practice teaches the other.

People find it surprising that I play guitar seriously alongside doing this work. I find it surprising that more programmers do not. The practices share more structure than they appear to from the outside.

Both are compositional. You assemble small elements into larger forms according to rules — harmonic rules, typing rules, architectural rules — that you internalize until they are not rules anymore but instincts. The beginner musician thinks about chord shapes. The advanced musician thinks about what the next phrase needs to say. The beginner programmer thinks about syntax. The senior engineer thinks about what the system needs to do in three years.

Both reward constraint. The most productive sessions I have — in code and in music — happen when the problem is well-defined. An unlimited canvas does not produce better work. A twelve-bar blues produces better improvisation than 'play whatever you want' because the constraints force you to be precise within a frame. The same thing happens when you commit to a design system rather than making every decision fresh each time.

The place where they diverge is feedback latency. In music, you hear the note in real time. In code, you compile, run, and look. The best code environments try to close this gap — hot reload, REPL environments, visual debugging — and the most productive programmers are the ones who arrange their workflow so they are always close to live feedback.

What music teaches code: phrasing. The ability to read a section of code and feel whether it has a good rhythm — whether the abstractions are at the right level, whether the names are resonant, whether the structure resolves. That is an aesthetic judgment. It comes from the same place as deciding whether a phrase needs another note or whether the space should stay.