« Back to home

Code Kata

Posted on

In my attempt to learn Ruby and now Python, I’ve come across the idea of a “Code Kata”. I don’t remember where I ran across the concept first, but it seems that Dave Thomas (writer of “The Pragmatic Programmer”) coined the term. Essentially, a code kata is a small programming problem that you can solve multiple times – basically it is a method of practicing to improve your programming abilities.

Problems

The problems that I have chosen so far are:

  1. Grid Computing – Description
  2. Total Triangles – Description
  3. Anagrams – Description
  4. Trigrams – Description
  5. Word Chains – Description
  6. Tic-tac-toe – I found someone that had recorded a video of their screen while programming a tic-tac-toe game, but I can’t find the link at the moment.

The first couple katas (Grid Computing, Total Triangles) are pretty simple and are mostly about parsing input and then looping and processing ranges of data. The next three (Anagrams, Trigrams, Word Chains) are a bit more interesting and require a little more thought. Tic tac toe is the most complex and fun. All are pretty small problems and can be solved in a relatively short amount of time. It should be noted that I’m also including unit testing in this as well.

I’m a little concerned that these problems are fairly simple and I’m not diving into the real meat of the languages. For example, it would probably be a good idea to introduce some code to consume or host a REST service.

Progress

So far I’ve solved all the problems with Ruby once, and I’m almost done with the Python solutions as well. For completeness I think I will circle back and solve the problems in C# as well.

I have all my code in a local git repository at the moment. I haven’t decided if I will upload the code to github or not. It seems like a good idea to get some feedback from people with Ruby and Python experience.