
I have been a martial artists for over 20 years: Karate, Kung-Fu, Jiu-Jutsu and currently Filipino & Indonesian martial arts. Most traditional martial arts employ a series of movement forms or patterns that in the Japanese martial arts are called Kata. The purpose of a Kata is to build spontaneous instinctive reaction and motion. It is a method of refining movements to an efficient perfectly ergonomic motion.
Such repetitive focused study is not too dissimilar to the practice methods in other arts. A musician will spend years practicing scales and études (studies), and a fine artist will spend significant amounts of time practicing technique and form in sketchbooks. Such focused study is how an artist trains to master the techniques of their art to the point where they become spontaneous and apparently effortless.
Software development is based on principles of computer science. However, designing a solution to a problem and coding that solution into well formed computer code is a craft: as much art as science. Sara Chipps provides a good description of the qualities of developers who embody the art of programming in her article
Natural Programmers (Code Monkeys) vs. Career Programmers (Geeks in Suits). What stands out in her description of "Code Monkeys" is a total absorption and immersion in the joy and adventure of computer code. Code Monkeys live and breath code in the same way any other serious artist is thoroughly committed to their art.
Dave Thomas from
Pragmatic Programmers has started to develop an concept of
Code Kata borrowing the concept from Japanese martial arts. His argument is that most programmers learn their craft in the heat of battle while engaged in project work. The problem with this is that programmers tend to optimize on the solutions with which they have already researched and implemented and continue to follow those same solutions over and over again even though there may be much more efficient or elegant solutions.
A code kata is a focused study on a discrete problem with the emphasis on exploring different ways of solving the same problem. One of my favorite code exercises that could qualify as a code kata is the
196-algorithm. This has no earthly use whatsoever, but it is a good way to practice list handling, sort, recursion and many other different software algorithms. It has become my "Hello World" app when exploring new computer languages.
Of Dave Thomas' Kata I really like "
Kata Five: Bloom Filters" particularly since it is working with bit sets, hashes and I have come across a sufficient number "item is member of set" problems for this to yield some interesting results.
Other than the CodeKata blog I would recommend Steve Yegge's article
Practicing Programming as a source for Code Kata, or practice drills as Stevey calls them. Perhaps you can come up with a few of your own?