Martial Art Can Improve The Way You Code? For Real? How?
When I was still in elementary school I used to take martial art class, specifically Kyoukushin karate. And when you get to a certain level, you have to perform some series of karate movements / form called kata, for example this one. So, why am I talking about martial art in a development related blog?
Apparently some coders like Dave Thomas and Uncle Bob (in this podcast) believe that us coder can learn something from martial art. Really?
One used of kata in Karate is to build up one's muscle memory. Once you learn the form, it will come easily to you when you need to perform it.
Dave believe, just as kata in martial art can improve the practioner's skill, by adapting kata in coding (by performing a series of coding exercise repeatedly), can hone your skill as a programmer through a lot practice and repetition. Thus he coined the term Code Kata.
Actually, I heard about this a while ago, but I never took any real interest in it, until a couple days back when I listed to this particular Herding Code podcast. In the podcast, they talked about someone doing this String Calculator Kata in Python and Vim. The actual topic was not even about the kata, but about how awesome this guy in using editor like Vim. Anyhow... As I said before, it made me interested, so I looked it up on the net and found this. Which if you are not familiar with the context, you will be scratching your head while watching it... like myself :). So I go search around a bit more on String Calculator Kata and found out that Roy Osherove was the one who created it and I found out the context that I need to understand just what the heck the previous video is about, here. So, I decided, what the heck, I'll give it a try in C# and the MS Test framework that comes with Visual Studio. Doing the usual TDD red green refactor steps, I managed to complete the kata to what I think was satisfactory result. Roy also posted a bunch of kata-cast on the same page and I decided to give some a look and a glance and stumbled upon this one. And boy, I was watching it with my mouth half opened on some of the stuffs that they did in that katacast which sort of open my mind and eyes to a whole lot of possibility (on how to use LINQ, lambda & fluent interface programming style.
Not that I'm going to do this daily from now on, but I do think practicing the code kata from time to time will benefit me in the long run, so I'll give it a try, perhaps in multiple different languages, which should also be a good way to learn the language that I want to learn like Ruby for example.
So, what are you waiting for? Learn it, Practice it, Love it... Happy Code-Kata-ing?? Is that even a word?