What is a Coding Kata?
The metaphor is a martial arts kata or form. Martial artists practice and REPEAT a precise set of steps until they perfect it. The purpose of this practice is to train their muscle memory so they can react at speed with the same behavior when sparring or in an actual fight.
With a code kata, we practice and repeat a precise set of coding steps to perfect a coding skill and make it second nature when we run across a scenario for it in the wilds of actual development.
If you’d like more detail on the what and why of code katas, check out this excellent treatise over at CorporateProgrammer.com.
The Bowling Game Kata
The great granddaddy TDD kata from Uncle Bob Martin. I still enjoy this one from time to time and often start new people here. The original is in Java. See a great C# version here.
Legacy Code Kata v3.0
Here is one I came up with… and revised over time. Legacy Code Kata helps train methods of dealing with code that is difficult to unit test because of dependencies and poor separation of concerns.
The String Calculator Kata
A great kata produced by the author of The Art of Unit Testing himself, Roy Osherove. Enjoy, and you’re welcome!
Helpful Kata Tools
An organizational tool for guided katas.
Fun coding exercises in multiple languages.
Additional Lists of Katas
If you know of good katas, kata lists, or tools for katas, shoot me a tweet @dubmun and I’ll add them to the list. I’m not looking to be exhaustive, just adding the best of the best.