Dave Thomas (the Pragmatic Programmer, not the Beloved Burgermeister) has been thinking about the value of a disciplined practice regimen in programming. He talks about martial arts training, where set katas, or forms, are repeated over and over again, until the movements are ingrained in the practitioner’s motor memory. Once these katas are fully learned, the practitioner engages in kumite, or sparring, where they work on how to make use of the movements they’ve learned. So practicing forms teaches them the basic mechanics without context, but when they use the mechanics in sparring long enough, though, they begin to use those moves in context and without effort.

Musicians do the same thing: études and studies tend to concentrate on a particular aspect of technique, and by playing them over and over, you build your chops in preparation for more difficult pieces. In jazz, programs like those in the Aebersold books provide an even closer parallel with kata and kumite — you practice the changes and substitutions and licks over and over again, and when it comes time to improvise, you combine these elements in every way possible within two choruses, without consciously thinking about what it is you’re doing (“I’m just playin’, man”).

Athletes also have rigorous training designed to internalize skills (not that my lazy ass would know anything about that). They spend hours at batting practice or doing three-man weaves, so that when someone asks them what they’re doing in a game, they can say “I’m just playin’, man.”

So why is it, Thomas asks, that programmers don’t get any of this type of practice? Of course, we do learn through repetition: I don’t always need the Javadoc up in my browser; Lord knows I’ve imported java.util.ArrayList enough times to know what’s in there. But what about the Gang of Four or Sedgewick? It’s always been my opinion that there’s no better way to learn how to apply algorithms and patterns than to use them in a project and see what works, as well as what doesn’t. Is there a way we can get people to practice in a focused setting, away from their main projects, where they should be applying these techniques instinctively rather than learning them over and over again? Can we get programming to be less work, and more “I’m just playin’, man?”

(This whole discussion is about proficiency and mastery of programming techniques; it doesn’t even begin to address the sorry state of basic non-academic programmer training in the world today. The number of professional programmers who haven’t even heard of GoF or Sedgewick, or even the words algorithm and pattern is a number that I suspect is frighteningly large.)

Going back to Thomas’s martial arts analogy, I’m reminded of the (possibly spurious) Bruce Lee quote I’ve heard a number of times: “Before I learned the art, a punch was just a punch, and a kick, just a kick. After I learned the art, a punch was no longer a punch, a kick, no longer a kick. Now that I understand the art, a punch is just a punch and a kick is just a kick.”