Dec 23 2009

What I learned doing a Katacast

Category: me,presentationgiordano scalzo @ 10:32 am

As said before, last week at Milan Xpug meeting, we organized a kata evening, with the same challenge done with different language.
During the practice to reach a quite well solution, I publicized my attempts through Twiiter gaining attention from Corey Haines hinself who asked me if I was interested to appear on katakasts.com as a guest: wow, I felt like a teenage U2 fan who, while playing in garage, receive a call from The Edge asked him if interest to play some concerts with them!

Anyway, I tried to record a good enough kata, that means without compilation error, in resonable time and typed in smooth way.
That could sound as a straightforward thing to do (I thought it that way), but I invite everyone tho give it a try: I did almost 10 complete recording, not counting all false starts or big mistakes near the end of kata.
I noticed how often I did errors in first steps, I think while I’m not into the “flow”, or at the end, when I start to relax.

Anyway, the only way to perform a Kata in a acceptable time for katakasts.com (less than 15 minutes) is to master the editor of choice.
I use vim for kata, but I’m far to be ‘fluent’ on it! Anyway, to save precious time, I learned a few usefu thricks.

First of all, we need to forget to navigate the text throught 'hjkl' or arrows keys, and use the line numbers features of vim.
With this command:

:set number

every line will appear with its number.
Almost every command of vim should be applied to a range of rows.
For example with this:

:20,30 co 35

we copy the block from line 20 to line 30 to line 35.
Or with this:

:20,30s/java/scala/g

we change word java with scala in previous code.
A little variant is

:20,30 co .

that copies the block at the current cursor position.

Anyway, you can enjoy these and other basic vim tricks in my Katacast:

KataCast: StringCalculator in Scala from giordano scalzo on Vimeo.

Technorati Tags: , ,

Tags: , ,