Tuesday, January 30, 2007

Ruby Hacker Interview: Jens Kraemer

I recently completed an interview with Jens Kraemer, a german Ruby Hacker, and the author of several Ruby and Ruby on Rails tools. Read on to learn more about Jens and what he's doing.


To begin with, would you please introduce yourself to the readers?

Jens: I'm 28 years old and live in Dresden, Germany.

I work as a software developer at webit!, a mid-sized IT-consulting and software development company specializing on web-based applications. I also keep a blog.

I started studies in economics and engineering at the Technical University of Dresden in 1997. Though I always was fascinated by computers and especially by letting them do what I wanted, I choose not to study computer sciences because it seemed far too theoretical to me. Later in my studies I selected computer science courses wherever possible (picking the interesting topics, and leaving out the theoretical ones, of course ;-).

I started earning money with software development in 2000 when I joined webit! for what I thought would be a summer job developing an e-commerce portal. The project died the .com death, but I kept working at webit! while trying to finish my studies by the way. So it took some time, but in 2004 I finally finished my diploma thesis. I stayed at webit! without looking around too much for alternative jobs, just because it's a really great place to work, without too many rules and with lots of cool people around.

How did you discover Ruby?

Jens: I don't know for sure, but I think the first time I heard about Ruby was in a conversation with Steffen Gemkow, an IT consultant from Dresden. Must have been 2002 or 2003, I think.

I then had a look at it, but at first underestimated it's power. I liked it more than Perl because of the cleaner syntax, and so I used Ruby for what I would have done with Perl otherwise - small scripting and screen scraping tasks, and some data import/export/conversion jobs.

I was a Java guy at this time and I didn't think too much about using Ruby (or any other scripting language) for 'serious' web apps.

Later I discovered an early version of Rails while looking for some ORM layer to simplify a database migration job I planned to do with Ruby.

I found quite interesting what I saw, tried it out in a small side project, and fell in love with it right away. I think the real secret to Rails' success is the Ruby language, at least that's why I prefer it to all the other newish Rails-like web frameworks written in other languages.

Are you using Ruby professionally?

Jens: Yes, we already did several Rails projects at webit!, some for customers, some for internal use. Right now I'm working on an ecommerce solution implemented in Rails for a publishing company here in Saxony. It allows customers to subscribe to online and printed versions of several official publications concerning saxon law and administration. Ferret-powered full text search is available to registered users, too. The site is located at www.sachsen-gesetze.de.

As time permits, I also do some Ruby/Rails freelance work.

What other languages are you using?

Jens: Recently I was involved in C# and Perl projects. Before that I've built J2EE web apps for several years.

What is the Ruby community like in Germany?

Jens: As far as I can tell - quite small ;-) But it seems to be growing. I really can't say much about this, there's not much activity Ruby-wise in or around Dresden. In other areas (Berlin, Hamburg, Frankfurt) there seems to be more movement, though. There's a quite low traffic german rails mailing list.

But Ruby seems to get momentum, recently a potential client explicitly asked for Ruby experience ;-)

What projects are you working on with Ruby?

Jens: Besides building web applications with Rails at webit!, I currently maintain two Ruby-related open source projects:

  • RDig is a full text indexer for web sites and file systems written in Ruby
  • acts_as_ferret is a Rails plugin for easy full text search across model data.

Both projects are built on top of David Balmain's great Ferret library.

In addition to that, I'm involved in the soon-to-go-live project led by Benjamin Krause, that David talked about in his interview ;-)

What can you say about this project?

Jens: OK, time for some planned leakage ;-)

The project is called Open Media Database or short, OMDB. As the name says, it's a database about media. Our goal is to provide objective, correct and structured information about media of any kind, be it books, movies or music. To reach this goal we combine full text information with structured, domain specific data. For now, the scope of the platform is limited to movies.

Basically all data will be open for editing by the public, just like Wikipedia. To ensure the correctness of the structured data, it is possible for a team of editors to freeze never-changing relationships like 'George Lucas has made Star Wars' to a non-editable state after they have been confirmed as correct.

All information will be published under a free license. we're currently looking into the CC and GNU license versions. Of course we plan to provide APIs for easy access to the database.

At the moment we're busy getting ready for a public beta. A team of film students and journalists is entering content into the site as we don't want to go live with an empty database.

You can have a look at our current development version here.

It's our testing server, so expect the occasional hiccup ;-). As we're mainly german natives, most of the content already entered is in german, too. But we plan to go live at least with english as an additional language. Most of the user interface already is translated.

We also have a blog.

Can you give some examples of how Ruby makes Rails better?

Jens: In general Ruby tends to not surprise it's user - most of the time even a novice developer can guess how to do something. That makes it very easy to get started with Rails for people coming from other languages.

From a more technical point of view, I think one of the important Ruby features that make Rails what it is is objects and classes being open to extension from the outside after their declaration. That enables the little goodies like '3.weeks.ago' as well as custom methods in Active Record relationships and plugins that build complex stuff such as versioning right into the framework.

Another example of using Ruby's power in Rails is when you create your own DSL for use in your integration test sessions - telling user stories with statements like 'joe.buys_a_book' makes testing really fun.

Another point is that in a standard Ruby installation, you have almost everything you need, in terms of functionality. So, any special needs aside, you have Ruby, Rails, and maybe the ruby-mysql bindungs, but that's it. You can start hacking away on your project and chances are you don't need any other libraries. Depends on the project, of course, but it makes installation and maintenance in general much easier if you have less external libraries to watch.

Compare that to Perl, where even object orientation is implemented in external modules. A project like Catalyst has to depend on so many external modules (not talking about the project itself being split into another huge set of modules), that it really can be a hard job to get everything installed in the right versions. Imho, you have to be a hard core Perl hacker to get a successful start with Catalyst. I don't want to say the way Perl does handle this is plain wrong, but it makes it harder to get up to speed with a new project, especially for people who are new to the framework and the language.

What problems have you seen with Rails?

Jens: Deployment could be really hard in the beginning (say before Mongrel was there). Zed Shaw is really doing a great job with Mongrel, and it became my preferred deployment platform right from the start.

Otherwise, I'm really happy with Rails :-)

Have you looked at JRuby at all for bridging the Ruby/RoR and Java worlds?

Jens: I did a short look at it, but at the time (I guess somewhere in between 2004 and 2005) it was still quite inactive and I decided to not try using it in production code. Maybe I would have taken a second look after JRuby got up to speed recently, but I didn't do any Java projects since then.

That said, a working .NET integration would be what I need now ;-) I've been watching the Gardens Point Ruby.NET Compiler project for a while now, but I think it will take at least a year until we can talk about using Ruby e.g. in an ASP.net web app.

I'm not an RDig user, can you tell me a bit more about it? Do you know how many people/projects are using it?

Jens: RDig mainly does three things:

  • crawl for documents
  • extract content from those documents
  • index that content with Ferret

The crawling can take place in the file system, or on the web.

For content extraction there are pluggable content extractors for various formats (pdf using xpdf-utils, doc using the wv utility, and html - here you have the choice between a Rubyful Soup based extractor, and one based on the hpricot lib). The hpricot content extractor was the great news of the latest version of RDig, since it's way faster than Rubyful Soup.

In theory, the indexing backend could support other indexing libs, too, but I didn't feel the need to implement one yet.

There's also a CLI for querying the ferret index created by RDig, but that's more for testing purposes. You're supposed to write your own frontend for your index, think of the search in your intranet, or for a site search on a public web site. RDig however has some code to make accessing the index easy, there's no need to learn the Ferret API.

For the numbers, they're quite small. There have been 25/31 gem/tgz downloads of the last version in 2 months. However I have mails from several people successfully using it for tasks like intranet search. Some even send me patches - so I guess it's a useful tool for some people.

At webit! we use RDig for a client who has a web site that in large parts is built by a CMS that publishes static HTML pages. RDig crawls the site via HTTP every night and so rebuilds the index that is used for the site wide search (which is implemented in Rails).

1 comment:

Anonymous said...

I would just like to point out that there is a very active German Webforum at http://www.rubyforen.de, which just recently surpassed 1000 registered Users. Granted, not all of them are active, but there is a good amount of activity going on there, especially in the Rails Section.