Code Kata

For some reason this whole Code Kata movement passed me by, so I'm coming late to the party, but I'm getting hooked.

The term kata comes from Japanese martial arts and means "detailed choreographed patterns of movements practiced either solo or in pairs" (wikipedia). The intent is to practice and practice some sequence of movements until it becomes second-nature, flowing, and effortless. Repetition, practice, training.

When applied to programming, it's the same intent. Every day, you take 30 minutes or so and and write some code; the same code every day. It's like practicing scales when you learned how to play the piano: every day you'd repeat the same scales, getting better at doing them, polishing, polishing.

The object is not necessarily to think of different ways of implementing the same solution, but to practice writing the same implementation from scratch every day, and throw everything away at the end of the session. You are learning your development tools through repetition; you are rehearsing your basic programming skills; you are not writing code for posterity.

Many code katas emphasize TDD. That is, once you've worked out the solution to your kata problem, you work through building it test-first and practice doing it. Perhaps you'll see different ways of working your way through the red-green-refactor cycle and slowly modify your approach. But again it's not particularly about that, it's about rehearsing your coding abilities for a certain set time every day, no matter what else happens that day.

I was talking to my old friend Maxx about this recently because we were both bemoaning the fact that we hardly program any more, and we really wanted to get back into it, to feel the Zen of being able to write code quickly and effortlessly. This is one way to prepare ourselves for that.

For some examples of code kata, check out these sites:

I've started with Roy's suggestion and once my kata session is elegant and effortless (!), I'll record it for a DevExpress video (since I'll be using CodeRush).

Album cover for Outlandos d'AmourNow playing:
Police - Roxanne
(from Outlandos d'Amour)

Loading similar posts...   Loading links to posts on similar topics...

1 Response

#1 Dew Drop – February 25, 2010 | Alvin Ashcraft's Morning Dew said...
25-Feb-10 7:21 AM

Pingback from Dew Drop – February 25, 2010 | Alvin Ashcraft's Morning Dew

Leave a response

Note: some MarkDown is allowed, but HTML is not. Expand to show what's available.

  •  Emphasize with italics: surround word with underscores _emphasis_
  •  Emphasize strongly: surround word with double-asterisks **strong**
  •  Link: surround text with square brackets, url with parentheses [text](url)
  •  Inline code: surround text with backticks `IEnumerable`
  •  Unordered list: start each line with an asterisk, space * an item
  •  Ordered list: start each line with a digit, period, space 1. an item
  •  Insert code block: start each line with four spaces
  •  Insert blockquote: start each line with right-angle-bracket, space > Now is the time...
Preview of response