Jazzers and Programmers

Posted by Nick Sieger Sat, 19 Jul 2008 19:34:00 GMT

At RubyFringe, I could have gone the easy route and talked about any manner of tech that I’ve been working on or associated with, including JRuby, JRuby-Rack, Warbler, image_voodoo, Glassfish, activerecord-jdbc, Connection pooling for Rails, or Ruby-Processing. Instead, I took a risk and went in a completely different direction. What follows are some thoughts I expressed in the talk. I’d be interested to hear your take as well.

Jazzers and Programmers

Why do we program? Why do you program? Not the 9-5 systems analyst working for a paycheck. I’m talking about you and me; we, the passionate fringe of the programming world. Fame and fortune? A knee-jerk answer, but that’s not the one I’m looking for. What I think drives great programmers is the desire to learn, share, collaborate, and constantly get better at what you do. Which might explain, to a large degree, why all of you came to RubyFringe.

RubyFringe bills itself as deep nerd tech with punk rock spirit. So what are some elements of punk rock spirit that we identify with? While I enjoy and appreciate punk and its culture of DIY, I’m not an expert. However, I am passionate and knowledgeable about jazz.

At this point you may be shaking your head, “Sieger didn’t get the memo!”

rubyfringe kenny g

At which point I counter: if you think this clown and the music he plays is jazz, then prepare to be corrected, because you need to hear what I’m about to tell you. Listen. Jazz is punk before punk even existed. And if we’re associating ourselves with punk, the fringe, or, to use another word, vanguard, perhaps we can learn a few things from this truly unique American art form.

village vanguard

How did I pick this topic for my talk? I was thinking about the fringe, the vanguard and growing up nerdy and a misfit, which we probably all can relate to. In addition to my interest in computers, I was also a band geek. I wore ties on random days at school just to accentuate myself away from the “in” crowd. And after school, I played in the jazz band. Playing in the jazz bands continued through college, where despite my majoring (and graduating) in electrical engineering, I decided to move to New York City to experience the big city and hopefully continue to play jazz. Instead, in an odd but practical twist, NYC became my transition into a programming career. Because you gotta pay the bills somehow, after all.

Recently, after taking in David’s “Surplus” talk at RailsConf, although it sounds trite, I really took his suggestion to heart to look outside the programming world for insights on how to become a better programmer. I soon realized that jazz, my dormant passion, was that place right in front of me that might hold some of those crucial insights. And as odd as it may appear that I am speaking about jazz at a programming conference, I thought I’d share some thoughts about this from my vantage point as programmer and jazz musician. (Plus, I get a kick out of saying that I came to RubyFringe, stood up in front of a captive audience, and auditioned jazz clips for 30 odd minutes.)

Styles of Jazz

It’s taken me all my life to learn what not to play. – Dizzy Gillespie

Jazz as a unique musical style is incredibly diverse. Its history spans over a hundred years, and is remarkable in its breadth. From Ragtime, New Orleans “Hot” Jazz, Swing, Bebop, Cool, Hard Bop, Free/Avant Garde, Jazz Rock/Fusion to splintering into a thousand directions, the music was (and is) constantly evolving and changing with the times.

The history of programming is undergoing a similar arc, but is nowhere near as developed as a communication medium as jazz is. Whereas modern programming only 40-50 years old depending on when you start counting, jazz was just getting a head of steam at that point. You could break it down like this: C is akin to New Orleans “hot” jazz: foundation for much that followed, and still relevant in a lot of ways, but definitely showing its age. Java is like swing (literally! c.f javax.swing.*): appeals to the masses, anyone gets it without a lot of cognitive load. Ruby is like bebop: favors minimalism, more powerful, more intellectual, and less understood.

So what does that mean for the future of programming? We’re already seeing an increase in DSLs, polyglotism, and languages and tools used for specialized purposes. I would expect that trend to continue, and using the development of the many styles of jazz as a ruler, would say that there will not be a Next Big Language (NBL). Specialization and niche skills will be increasingly important as differentiators in our careers, but that means there will also be plenty of opportunity to stake out that new ground for ourselves and become leaders in these new specializations.

Jazz Fundamentals

Anyone can make the simple complicated. Creativity is making the complicated simple.” – Charles Mingus

Jazz as a creative medium has a number of compelling features that surround the music itself as well as the players. Let’s examine a few of these, using them as a mirror to reflect on programming.

Instrumentation. The modern jazz small ensemble is built upon the rhythm section -- piano, bass, and drums. The bass is the starting point, and is responsible for marking the beat as well as laying the harmonic foundation, often by “walking”. Because of this critical role, the bass player in a jazz band is almost always positioned in the rear-center of the stage, between the piano and the drums. The piano and drums also have a role in keeping time, but have more freedom in creating tension and dissonance by layering rhythms on top of the bass, in an activity known as Comping.

The easiest parallel to programming is libraries, frameworks and patterns. These are the building blocks upon which we code. A well-designed library makes your work as a programmer easier and more enjoyable in the same way a solid, experienced rhythm section complements a soloist.

To use an example from web programming, may I suggest Bass-Drums-Piano == Model-View-Controller?

m-v-c

When you hit a wrong note it’s the next note that makes it good or bad. – Miles Davis

Musical Structures. Much of bebop and straight-ahead jazz employs the well-established structure of the head, followed by solos, and finally repeating the head. The head is basically a crib sheet that consists of a tune or melody (usually a well-known jazz standard) and a set of chord changes that forms the harmonic basis for the entire piece. During the solo section, one or more musicians improvise over the changes for one or more “choruses”.

blue-monk

The 12-bar blues is easily the most common form found in jazz. It is usually the first form that a budding jazz musician practices when learning how to improvise.

Every working jazz musician is expected to memorize and be able to play a large number of tunes and harmonic structures. This body of tunes is exemplified by the Real Book, an underground, illegal transcription of a large number of tunes by some Berklee College students in the 70’s that has become a standard part of a jazz musician’s toolbox.

Collectively, these musical conventions and rules form a jazz vocabulary and a shared ritual that allow musicians to play together in a jam session without having played together before.

The takeaway is that conventions and standards, when organically grown, tend to be powerful, liberating forces for communication and collaboration. There was no OASIS- or W3C-like committee that sat down when the roots of jazz were taking hold and dictated that it would be played this way. It just happened, night in, night out, on bandstands and in sessions all over New Orleans and Chicago and New York.

I believe that some of the best examples of programming and technology embody those same ideas. Certainly Rails is a shining example in the programming world of such a set of conventions and how they allow you to be productive no matter what Rails project you’re working on.

It was when I found out I could make mistakes that I knew I was on to something. – Ornette Coleman

Improvisation. Making it up as you go. Jazz wouldn’t be jazz without improvisation. The whole concept of improvisation in jazz builds upon the conventions and structure, but gives you the license to do whatever you want. Improvisation is what turns those constraints into freedom. Conviction is the key. Get up and play, tell your story, tell it with conviction, and there will be no wrong notes.

Improvisation is also where the musical conversation happens. Where the soloist connects with the crowd and his/her fellow musicians. As a listener, following along with that conversation sometimes takes a trained ear. But there are still some musical devices that are easy for anyone to appreciate and can give you something to listen for.

Trading fours is a conversational device between players in the group. Most commonly, it’s used to give the drummer a chance to stretch out by alternating four bars of soloing with one or all of the instrumentalists. It’s a great way to enjoy the inventiveness of the group collaboration element of jazz by listening to how the soloists play off each other in short spurts.

An outstanding example of trading fours can be found in “The Blues Walk” between Clifford Brown and Harold Land (at about the 5:30 mark in the tune). They trade fours for two choruses, then twos, then ones, then halfs. The lines they weave are unreal!

Quoting is humor and inventiveness applied to improvisation. It’s named for a device where a player spontaneously inserts a recognizable melody into the middle of a solo. It’s basically easter eggs applied to jazz. Dexter Gordon and Sonny Rollins are two players known for their penchant for breaking out and quoting in the middle of a solo.

Improvisation and Programming

Learn the changes, then forget them. – Charlie Parker

As far as programming is concerned, it’s harder to see how improvisation can translate. Chad Fowler recently posted about programming as performance, asking for examples. Unfortunately, most of the examples given use programming as a means, but with some form of multimedia art as the end. I’d like to see programming performance where the code itself is the end result.

Do programmers improvise? I certainly believe that the best ones do. While it may be hard to capture the spontaneity of pure, real-time improvisation in a way that maps to how we write code, I think we can get close.

Continuous rewrites. Consider Fred Brooks’ axiom, “Plan to throw one away; you will, anyhow.” Jazz musicians do this on the bandstand every night! What if, rather than throwing one away, you rewrote a non-trivial piece of code five, ten, twenty times? What do you think would come out of that exercise as a result?

Live coding as a performance and teaching mechanism. I think live coding is an awesome example of spontaneity and risk-taking in programming, and one that not enough people attempt. Have you ever looked over the shoulder of a great programmer? It’s fun to watch, because you learn a lot. I could easily sit for an hour watching a seasoned programmer create code while working in their own environment. On the other hand, there’s a trend in conference talks where the presenter, to avoid the wrath of the demo gods, stands idly by while playing back a pre-recorded video of the demo. Sorry, I don’t buy this. If it’s not live, it’s not real. Let’s make live-coding something we all strive to do! Don’t be afraid to show the audience that you’re not perfect!

Do not fear mistakes. There are none. – Miles Davis

Instead of a hackfest, try a Coding Jam Session. Hackfests only rarely unite people to work toward a common cause; people enjoy the communal feel but too often people revert to working on their own thing instead of collaborating. Sprints are better, where the general topic or project is shared but each person is still working on their separate pieces. Rather, what I’d like to see is a group of programmers working toward a single shared goal. Plan ahead for a gathering of a handful of people for a lengthy period of time, say 8 or 12 or even 24 hours. Agree upon a theme or rough plan ahead of time, but allow for serendipity and improvisation to take hold of the group during the session. Get together, and start writing code. Try “trading fours”, allowing each person in the session to drive and add their bit of code into the mix in short spurts. The overarching theme should be collaboration and building on each other’s contributions. Avoid negative responses, such as saying “No” or “Yes, but...” or taking over and deleting or substantially rewriting someone else’s code. Instead, say “Yes, and...”. Imagine yourself on the bandstand, where once a note is played, it can’t be taken back. Really try hard to put away your devil’s advocate side or need to take control and instead play up to each others’ strengths. Depending on the blend of personalities, this could be a great way to spike a idea for a new website or a startup!

Group Gitjour repository sharing. Crazy idea: what about using gitjour at a coding jam in a mode where everyone broadcasts their own repository and adds everyone else as remotes? Commit notifications could be broadcast on the local network with Growl or a similar tool, and pulling in someone else’s changes could be a simple short one-line command, or perhaps even automatic. Imagine writing code together where suddenly a git merge is done for you automatically and the text changes right before your eyes right in your editor! Real-time collaboration!

Join the conversation!

I hope you’ll join me and post your thoughts about some of these ideas, either in the comments below or on your own blogs. And find some inspiration in your passions and pastimes you have outside of the programming world that help you become a better programmer and collaborator!

Discography

Those who saw my talk in person may be interested in this list of song samples. I personally recommend any of these albums. Information is organized as Section: Artist, Song, Album.

  • Intro. Naked City, Thrash Jazz Assassin, Torture Garden.
  • Ragtime. Jelly Roll Morton, Maple Leaf Rag (Morton style), The Library of Congress Recordings, Vol. 1: Kansas City Stomp.
  • New Orleans “Hot”. King Oliver’s Creole Jazz Band, Dipper Mouth Blues, Louis Armstrong And King Oliver.
  • Swing. Duke Ellington & His Orchestra, Take The “A” Train, The Fabulous Swing Collection.
  • Bebop. Charlie Parker, Koko, The Complete Savoy and Dial Studio Recordings.
  • Cool. Miles Davis, Israel, The Birth of the Cool.
  • Hard Bop. Herbie Hancock, Watermelon Man, Takin’ Off.
  • Free. Ornette Coleman, Free Jazz, Free Jazz.
  • Jazz Rock. Miles Davis, Black Satin, On the Corner. (Also remixed on Panthalassa: The Music of Miles Davis, 1969-1974.)
  • Contemporary. The Bad Plus, Iron Man, Give.
  • Walking. Sonny Rollins, Blue Seven, Saxophone Colossus.
  • Trading Fours. Clifford Brown, The Blues Walk, Clifford Brown and Max Roach.

Update. I’ve posted a muxtape of the songs here. Enjoy! (Also, I had to substitute Focus On Sanity from Ornette’s Shape of Jazz to Come album due to the length of Free Jazz. SoJtC is an early free album, a little more digestible than FJ.)

Tags ,  | 13 comments