Tuesday, November 07, 2006

Jarkko Laine is a 26-year-old web developer from Tampere, Finland. He's worked on web-related technologies since 1997, first for fun and then slowly turning the passion into a business. He and Christian Hellsten co-wrote Beginning Ruby on Rails E-Commerce: From Novice to Professional for Apress, which was published on the 6th of November 2006. A little while ago, Jarkko and I did this interview.

How did you discover Ruby?

Jarkko: I was working for some projects on OpenACS, a web framework built on AOLServer and TCL, when my friends and then OpenACS core team members Lars Pind and Peter Marklund from Collaboraid in Copenhagen, hired David Heinemeier Hansson to give them an introduction on Rails. They were instantly sold and raved me about it. In two months I was working on my first commercial project on Rails. So I came to Ruby because of Rails, but I actually learned Ruby (reading the Pickaxe2 from cover to cover) before doing any major Rails work. I had a very strong theoretical background in OO programming from university so for me everything in Ruby clicked right away.

Do you think that learning Ruby before RoR gives you an advantage over Rails hackers with less Ruby background?

Jarkko: I don't necessarily think you need to know Ruby inside and out _before_ jumping on Rails. But Rails leans so strongly on many Ruby idioms that you lose a lot if you just think you can wing it. You still see people iterating over containers an picking items from them manually when they could just write array.map(&:id). I think many people who think Rails benefits are overrated actually think so because they can't see the pros Ruby brings in.

How much Ruby does someone who's picking up Rails need to learn to really become proficient with Rails?

Jarkko: I think understanding the object model ("everything is an object") is crucial, as well as all the container methods like map/collect and inject. I think those + the Ruby basics are enough to get you going. However, if you really want to be proficient, you need to know your tools well, and that means knowing your Pickaxe. I don't want to frighten people, though. If you're a good OO hacker, you can pick up Ruby very quickly, and in the process experience a lot of those "oh, why didn't we have this in language X?" moments.

What role does Ruby play in your day to day work?

Jarkko: Currently it's Ruby and Rails all the way. I love doing the front end stuff, too, but I couldn't think of doing it on top of anything else than Rails these days.

How did you come to write a book about Ruby?

Jarkko: My co-author Christian Hellsten was contacted by Apress and he asked me if I would want to join in. Christian is the one of us with very strong domain knowledge about the subject and I'm then the Rails guy, although that difference is very subtle.

One thing that sort of leaps out is your relationship with Christian. Did you two work together before starting the book? How did you meet?

Jarkko: We haven't actually met, not in person. I think that's one of the true miracles brought by the internet and open source. You can work together with people you have never met but whom you've learned to trust because of what they've done. I think many Rails core team members met for the first team in person in Chicago Rails conf and the rest now in London. Still they've been working on a common goal and vision with a noticeable success.

What sets your book apart, why should people buy it?

Jarkko: We tried to write a very practical book. The book is structured task-oriented, and the different Rails concepts are introduced when they're needed in the building process. So I think it's a very good choice for people who like to learn by doing.

Can you give us an example of this?

Jarkko: The book is organized by tasks, just like proposed recently by Kathy Sierra. We don't have a chapter for ActiveRecord, for example, we have a chapter for creating a shopping cart. We do cover a lot of ActiveRecord (sprinkled around the book), but ours is not a reference
book at all.

What was the most rewarding part of writing your book?

Jarkko: Every time I submit a chapter draft in the middle of a night I feel like finishing a marathon. Tired, but still very happy. It's also an honor to be able to give back something to the great community that has built around Ruby and Rails, hopefully taking their success even further.

Yyou talked about marathons as a metaphor for writing and about athletic training. Are you a runner? What's the last race you were in?

Jarkko: I'm a national level orienteer. Orienteering is a sport where you run through an unmarked course in forest with the help of a map and a compass. It's quite a big sports in the Nordic and perfect for people that want more mental challenge than just running mindlessly :-) That said, I run also some track and road races.

What was the biggest challenge in writing it?

Jarkko: I think every writer with a day job knows how hard it is to sit down and start writing when others go to bed. Adding 10 to 20 hours/week of training of an athlete to that brings us very close to an impossible equation. Fortunately, our editors at Apress are a very good combination of understanding and pushiness so we have been able to progress all the time, despite sometimes feeling exhausted.

What did you learn from writing it?

Jarkko: People say that the best way to learn something is teach about it, and the same goes for writing a book. There's tons of background digging needed that never makes it into the book but that make you know a lot more about the subject than you ever did. Apart from that, the writing process in itself is a good lesson of self-discipline that I can recommend to everyone.

What are your favorite five libraries for Ruby?

Jarkko: Rails is obviously something of a living legend for me. Zed Shaw's mongrel web server is also no short of a wonder. But I also love all the smaller gems, like Geoff Grosenbach's Gruff graphing library. Other things I use daily are Test::Unit + RCov (with the Rails plugin, I'm a testing junkie) and Jamis Buck's Capistrano, the brilliant deployment tool.

What do you think is next for Ruby?

Jarkko: Native unicode support (I hope ;-)

What do you think is next for Rails?

Jarkko: A MySpace-sized Rails app (which seems to be the only way to silence the "it doesn't scale" folks).