What the Hell Are Katas?
Never heard of programming katas? Neither had I. The Wikipedia oracle has this to say:
Most [katas] in martial arts are solo forms in which a single martial artist performs a sequence that can represent a fight with an imaginary opponent, but can also simply be a succession of different movements.
What does this mean for the mortal programmer? For programmers, katas are small programming exercises that can be solved over and over again. You do not solve one kata after another; instead, you solve the same kata repeatedly.
That sounds pointless? I felt the same way until I tried it myself.
My first kata is by Roy Osherove. If you would like to try this kata (and I expressly recommend that you do), you should initially read only as far as the beginning of the numbered list on the following page, since that is the exercise. I also recommend not watching the videos yet. The link to the kata.
Once you have finished, you should watch one of the videos (in my case, the Java video) and compare the beauty, cleanliness, and readability of your own code with the code in the video. I was genuinely surprised and suddenly convinced of the value of programming katas: Sometimes practice does make perfect.
In everyday programming, it is difficult even to get close to perfection. This is mainly because most problems occur only once and are considered solved as soon as a working solution exists. Improving the solution the next time a similar problem occurs is difficult because you either still remember the old solution and simply recreate it (after all, it has already proven to work), or you no longer remember it and have to start from scratch.
With a kata, on the other hand, you have the opportunity to continuously refine everything the problem has to offer, until you know an almost perfect solution. But what good does it do me to know a perfect (or very, very good) solution? The answer is: to find out what good code feels like. With a sense for good code, you can quickly recognize bad code (or poor code design) flowing from your fingers and, hopefully, improve it while it is being created. (I can think of many other answers to this, but I will leave it to everyone to find them for themselves.)
Highly recommended: Try this kata; it will take only 30 minutes of your life!
PS: Most katas are written specifically for users of TDD (Test-Driven Development), which is also fairly easy to recognize from the structure of the katas. Nevertheless, you can of course solve the exercises using normal “brute force” programming.