Sunday, March 6, 2011

Learning a new language through testing

I've come across this very interesting talk by Ola Bini on Adopting the JVM in which he talks, among other things, about learning a new language.
I've been trying to learn Ruby for months now, and although it's being quite a slow process, it is kinda working, but the fact that I don't write it often is a big drawback. Ola mentions that a good way to get started, if you happen to write your code in Java, is to test your code with some other language supported by the JVM such as Ruby through JRuby.

A couple of posts ago I recorded a kata in which I was using cucumber and cuke4duke to test my Java code but my step definitions were written in Java, and my unit tests used JUnit. I guess the best way to practice more Ruby would be to write the steps in Ruby, and to use RSpec to drive the design.

A quick search yields the missing piece in the puzzle; JtestR allows for just that, testing (or stretching) Java code using Ruby. I haven't tried it yet, but I certainly can't wait! and the fizzbuzz kata (March's kata in 12meses12katas) looks like the perfect ground to put it into practice. Let's see how it goes!

No comments:

Post a Comment