Articles Feed

Authors

Categories

Kata: Langston's Ant in Ruby

by: micah | November 13th, 2008 |


Langston’s Ant in Ruby Kata Screencast

I’ve recorded my Langston’s Ant kata for all to see.

This particular kata, with slight variations, has been in front of an audience twice before. Once at a Software Craftsmanship group SCG meeting and again at RubyConf2007.

On both occasions I asked the audience to evaluate my performance on a scale of 0-10, 0 being the worst kata you can imagine, and 10 being the best. At the SCG, my performance was longer than the screencast because I didn’t use the instance_eval trick and wrote multiple case/when statements. It resulted in much more code as well. Honestly, I felt the kata dragged on a bit too long which is why I shortened in subsequent performances. Despite this, the SCG audience gave me an average score of 8. At RubyConf, the kata was almost exactly like the screencast and it earned me an average score of 7.

Now coming from an audience of dedicated Ruby developers, I’m quite pleased with my score. Here’s some of the feedback I got…

I find this feedback immensely valuable and thank those who took the time to provide me with it.

In martial arts, the techniques performed in kata are not always by the book. There is an aspect of art, creativity, and entertainment. At several points in my Langston’s Ant kata I intentionally decided to bend the rules to enhance artistic and entertainment values. I leave it up to you whether I made the right compromise or not.

After watching the kata, leave a comment with your rating and any feedback you have for me. I thank you in advanced.

3 Responses to “Kata: Langston's Ant in Ruby”

  1. Micah Martin Says:

    If you're interested in source code... http://github.com/slagyr/langston-s-ant/

  2. Michal Hantl Says:

    Hi, I like the idea of programming katas. This week i implemented turing and ram machine for fun and i found a lot about myself/my programming, that i want to improve.

    Also I feel that i could re-implement both machines over in time in a different way to see how i advanced. Thats what i value on those examples - i know i could solve them better each time.

    In case anyone would ber interested - heres my code http://github.com/hakunin/.

  3. Michal Hantl Says:

    Heres some thoughts of mine on the kata on vimeo:

    I think that the position of the ant on the world should be controlled by the world. What this means is that when ant is making a step, it should send the world a message and the world should return the new location.

    The ant does two kinds of steps - so i would test each on its own so i if there was a problem in the first kind of step, it wouldnt make the test with the other step fail.

    I dont quite understand why people are complaining about "First test, going from compile error to passing tests", i think thats exactly TDD is supposed to work.

Leave a Reply

#