Code Kata Cast

Have you ever come across the concept of a Code Kata?

For me it really took off after reading blog posts (1, 2, 3) by Unce Bob Martin and Pragmatic Programmer Dave Thomas. The concept is really simple: how can we, as programmers, better our selves and improve our techniques and proficiency in using the tools and processes in our every day work?

The suggested solution is inspired by the martial arts kata. You learn how to implement a solution to a specific problem and you practice all the moves in the exact same order over and over again. The point is that you should know the moves so well that you forget about them and focus on improving your key strokes and the use of your tool set. The never ending goal is to perform the kata with the least amount of key strokes.

The promise is that practicing these kata's often and regularly makes you a better and more productive programmer in that you are trained to act instinctively in certain reoccurring situations.

Calculator kata cast

Anyway, I've been practicing a kata based on a problem initiated by Roy Osherove and I decided to record it to get some feedback and maybe spread some knowledge on how I practice Test-driven development using ReSharper.


Calculator Code Kata Cast 1 from Rickard Nilsson on Vimeo.

Comments (16) -

  • Johan Lindfors

    11/11/2009 6:27:39 PM | Reply

    Nicely done Rickard, learned a lot during this 16 minute kata!


  • Andrea

    11/11/2009 6:28:01 PM | Reply

    Nice one
    You can use the R# test runner and assign a shortcut key ( i use Alt+X <X because I use xUnit> for Run Test and Alt+S for Debug)
    The shortcut key saves loads of time

  • Marcus Eklund

    11/11/2009 6:48:07 PM | Reply

    Nice one Rickard,
    A bit quiet though Tong Used to the classical music the other katas have Smile


  • Rickard

    11/11/2009 11:52:19 PM | Reply

    @Johan Lindfors Thanks!

    @Andrea I use TestDriven.NET to run my tests because it provides rally fast feedback. I've bound Alt+T to run all tests in current context, and Alt+R to rerun last test run.

    @Marcus Eklund do you know of any good royalty free music library? Wink
    I'll add some on my next cast, I promise Tong

  • Marcus Eklund

    11/12/2009 12:40:16 PM | Reply is a good place.

    Classical music is good also since that seems to be free, at least that is what is the common use of katavideos Smile

  • Rickard

    11/12/2009 12:49:54 PM | Reply

    @Marcus Eklund Classical music is royalty free since the composer usually is dead long ago. I believe there is a time limit for copyright for 50 years from the date of release.

  • Yann

    2/9/2014 12:48:38 AM | Reply

    Sorry, this was so difficult to read I had to give up watching it.

    • Rickard

      2/9/2014 12:49:17 AM | Reply

      I recommend watching the cast on in HD

  • Rickard

    2/9/2014 12:49:42 AM | Reply

    I'm sorry you find it difficult. The point is not the code I produce more to illustrate the flow of TDD and some tips on how you can leverage ReSharper to code faster.

  • bob

    2/9/2014 12:50:05 AM | Reply

    very difficult to read your black screen does not help

    • Rickard

      2/9/2014 12:50:41 AM | Reply

      try watching it on in HD

  • @jimfraley

    2/9/2014 12:51:10 AM | Reply

    It was much easier to read in HD as Rickard suggests. Watching these Katas is a great way to "look over someone's shoulder". Thanks for sharing.

  • Jim Cooper

    2/9/2014 12:51:33 AM | Reply

    Young bloke, you seem to have completely missed the point of these kata. It really, really isn't to get your keystrokes to the minimum. Have a read of Bob Martin's posts that you link to again

    • Rickard

      2/9/2014 12:52:11 AM | Reply

      Hi Jim!
      That's really interesting. Would you care to explain what you think is the point of a code kata I'd love to discuss it.
      Best regards

    • Ed W

      3/3/2014 6:21:01 PM | Reply

      The point of a kata is to make the everyday mundane things we have to do while programming second nature, so as a developer we have more time to focus on the more complex tasks.
      Bob Martin says this in his Clean Code videos. I think learning and practicing R#'r commands comes within this remit. While it shouldn't be the focus of every kata, It is a good way to "go faster".

  • JSparrow

    10/19/2016 8:24:41 PM | Reply

    Thanks for sharing the video.
    I have some remarks for the code you created:

    You have static  delimiters list and are adding additional delimiters to it when given custom delimiter.
    Doesn't it violate tests independence?
    As I understand if you add new test without delimiters, which is run after the one with delimiters, it should use that additional delimiter wrongly.

    And second cosmetic one:
    Do you think it would be worth to extract method in tests eg "AssertAddResult"?

    And third:
    You seem to not test thrown exception's message. Did you do this on purpose? Do you think it's not worth it?

    Thanks again

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.