![]() |
Articles Feed |
Categories
Archives
- July 2010 (5)
- June 2010 (4)
- April 2010 (3)
- March 2010 (2)
- February 2010 (2)
- January 2010 (1)
- December 2009 (1)
- October 2009 (2)
- September 2009 (2)
- August 2009 (1)
- July 2009 (5)
- June 2009 (2)
- May 2009 (2)
- April 2009 (8)
- March 2009 (7)
- January 2009 (2)
- December 2008 (3)
- November 2008 (5)
- October 2008 (4)
- September 2008 (6)
- August 2008 (4)
- July 2008 (5)
- June 2008 (5)
- May 2008 (4)
- April 2008 (2)
- February 2008 (4)
- January 2008 (2)
- December 2007 (2)
- November 2007 (2)
- October 2007 (2)
- September 2007 (1)
- August 2007 (3)
- July 2007 (1)
- June 2007 (4)
- May 2007 (7)
- April 2007 (2)
- February 2007 (3)
- January 2007 (3)
- November 2006 (3)
- October 2006 (3)
- September 2006 (17)
- November 2004 (1)
Kata: Langston's Ant in Ruby
by: micah | November 13th, 2008 |
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…
- Use of
instance_eval: -1 - First test, going from compile error to passing tests: -1
- Refactoring on with red bar: -1 (not repeated in the screencast)
- Non-idiomatic
is_black?: -0.5 (fixed in screencast) - Steps are too big in between tests: -1
- …
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.

November 14th, 2008 at 09:25 AM
If you're interested in source code... http://github.com/slagyr/langston-s-ant/
April 19th, 2009 at 06:51 AM
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/.
April 19th, 2009 at 07:09 AM
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.