December 17, 2009 9

String Calculator – Erlang

By Corey Haines in Katas

For our first in the series of ’same kata, multiple languages,’ we have a treat for everyone, Gabriele Lana is doing it in Erlang.

Gabriele Lana is a software journeyman living in Milan (Italy). Since 1998 he works as a developer and consultant. In 2000 he started using Agile practices in real time and embedded industries, proving their effectiveness in this domain. Since then he has always applied Agile values and principles to his work, doing coaching and mentoring to many teams in different fields (banking, medical, monitoring, …). He is currently developing products with Erlang, Ruby and Javascript.

blog: http://www.gabrielelana.it
twitter: http://twitter.com/gabrielelana
github: http://github.com/gabrielelana

Here is Gabriele’s description of his kata.

This is the String Calculator kata by Roy Osherove done in Erlang (R13B03), the standard EUnit application for the test execution and vim as text editor (without fancy plugins, only surround.vim). I have performed a few code kata before in a few languages but this is the first one recorded. I have discovered a huge value in recording and watching your own performance, you can spot many little but important improvements (thank also to Corey for pushing me to complete the kata in less than 15 minutes, the initial version took me more than 30 minutes). The obsessive search for the perfect flow could be seen as nonsense, but it’s what you learn in the journey that matters. I would love to receive some feedback and I hope you enjoy my performance.

I really enjoyed watching this one, as it has been a while since I looked at Erlang.

If you’d like to contact Gabriele:

blog: http://www.gabrielelana.it

twitter: http://twitter.com/gabrielelana

github: http://github.com/gabrielelana

Enjoy! And, as usual, feel free to comment. If you are inspired to do your own kata, please let me know.

String Calculator in Erlang from Gabriele Lana on Vimeo.

Oh, and +1000 points to Gabriele for using the music for Monty Python’s Oliver Cromwell song. :)

9 Responses to “String Calculator – Erlang”

  1. What’s the name of the Vim color scheme?

  2. Gabriele, I think you brought up an important point about recording your screen while practicing the kata and reviewing it after you’ve finished. That seems like it would be invaluable for reviewing mistakes and spotting bad habits.

    Your katacast is a testament to the fact that test-driving and refactoring a solution results in clear and understandable code.

    Also, I have never seen Erlang, but I was able to pick up on syntax incrementally rather than trying to digest all of it at once.

    Great job!

  3. filip says:

    Great job in mastering both erlang and vim.
    Keep up the good work.

  4. Alex says:

    Cool vim techniques! I think I would like to watch more vim katas.

  5. Richard says:

    Nice Kata!

    I have never programmed in Erland before but when you follow along from the very beginning its a lot easier to understand the syntax. So these kata’s could be a great start for anyone who wants to get a quick overview of a programming language and its syntax.

    I really enjoyed watching this kata in Erlang and i hope to see more Erlang kata’s in the future.

  6. eglyph says:

    Nice kata, Gabriele, very good kiai control!

    What were you using for the screen recording?

Leave a Reply