Code Katas: Programmer’s Deep Practice
Wednesday, September 2nd, 2009
I’ve recently blogged about talent and how it’s grown through disciplined, committed, error focused practice at the edge of your ability, known as deep practice. I guess now it makes sense to approach it from the perspective of programming: What’s programmer’s deep practice? Unsurprisingly, inspiration can be found in the great japanese culture, people who highly value discipline and self improvement. Specifically i’m talking of martial arts. If you were to learn, say, karate you would go to a dojo and perform katas. If you happen to be a programmer, you can go to a coding dojo and practice code katas.
Code katas, a term first coined by Pragmatic Programmer Dave Thomas, are small programming exercises geared to hone a specific programming skill. Traditionally, they tend to be algorithmic like parsing or visiting graphs but could as well aim to improve understanding of particular programming paradigms, like functional or object oriented, or a specific language. Also, as remarkably pointed out by Matteo, katas can be crafted to master a certain technology like web or database. While, as you may guess, Coding Dojos are sites, groups or communities which propose and maintain collections of katas hopefully with solutions and reviews.
So, how do you practice? I suggest you solve a kata, review your work, compare it to other solutions, share your code with others and discuss it. Then solve it again trying to take a different path, balance pros and cons, then solve it again and again, until you feel you internalized the essence of the problem. Finally, you can move to another kata. If it feels like a lot of work, then you got it right. No question mastership requires time and effort but, then again, masters are those destined for greatness.
Resources
- Katacasts
- 21 Code Katas by Dave Thomas
- Lots of Code Quizzes with Ruby Solutions
- Matteo Vaccari’s Technological Katas
- Coding Dojo Code Katas
- Corey Haines Video Solution in Ruby of String Template
- Uncle Bob Code Katas (search “kata”, ie bowling kata)
- Micah Martin on Code Katas and Video Solution in Ruby of Langton’s Ant
- Micah Martin’s BattleShip Tournament
- Google Code Jam
- Jeff Atwood on Code Katas
- Steve Yegge on Code Katas
- Peter Norvig on Deep Practice