During recent training events, I have heard the term Kata used to describe
exercises in programming. Specifically, I was witness to the Bowling
Kata by Uncle Bob to illustrate the power of TDD. At first, I really thought the
gimmicky word Kata was pretty silly. I happen to practice Kenpo myself (along with
all 4 of my kids) and I just could not reconcile the word. That is, I couldn’t reconcile
it until my latest Kenpo lesson when I mentioned this to my teacher.
A quick Google of define:kata will give some of these definitions:
-
A stylized set of movements that use a variety of blocks and strikes against
an invisible opponent. A kata is used to perfect style, learn focus as well as demonstrating
attack, defense and counter attacks. -
A “form” or prescribed pattern of movement.
-
A formal, prearranged exercise.
-
Pre-arranged forms used to practice a particular technique.
From my perspective, Katas are simply a way of taking a complex sequence of movements
and practicing them. Turning something into a Kata will:
-
Break the technique into it’s smallest components.
-
Force understanding and mastery of each component.
-
Cause the entire technique to be teachable by anyone who knows it.
-
Tempt the person who has mastered the Kata to wonder why it is so.
So the interesting part of this for us is that practicing the same coding technique
over and over will cause you to truly understand it. It will also cause you to look
for a better way and then to generalize your solution. My example is building Configuration
Section parsers in .Net 1.1. I did enough of them that I could write one in my sleep
now. Not only that, but I can easily explain it to someone else. Pretty neat.
This causes me to think that there is no harm in practice for the sake of practice.
That’s a new one for me.