Skip to content

Bye Bye Java, Hello Ruby

Maybe “Bye Bye Java” is a little extreme, but it got your attention I bet. Especially if you know how much Java I’ve done in the past, both professionally and in my spare time. So what could possibly make me give up Java?

Well there were really only two places where I was doing much with Java anyway. The first place is the applets, which are just for fun and are horribly inefficient and really don’t matter to anyone but me. The second is web apps. Coming from a Java servlet background, I was pretty convinced that that was the way to write web apps. I am just about to embark on a couple personal web app projects and was planning to write them in Java. I recently started using nHibernate (the object relational mapper for those who don’t know) at work for a C# project I’m working on and it is pretty slick. I was very impressed. I got a small domain model implemented with all the CRUD operations in about 5 or 6 days (with no previous nHibernate experience and very little C# experience). Given nHibernate is a port of Hibernate, I was fully planning on using it for my upcoming projects. Given the ease which I could now to db operations, I was all set to get back into the servlet world that I’ve been away from for a while.

And then I found Ruby on Rails. I’m not saying Rails is the silver bullet for web apps. I don’t know if it really scales (when using it with fastcgi). But let me tell you, the development experience was unbelievable. You want rapid application development? How about 10 hours from first going to rubyonrails.com to final deployment! I had no experience with Ruby, no experience with Rails and nothing installed on either my dev server or production server. And it took 10 hours to develop a whole app! Now don’t get me wrong, this is a simple app. It is just a contact form processor that chucks the contact information in the db and sends an email to a real person handling the contacts, but still. 10 hours! And I DIDN’T EVEN KNOW THE LANGUAGE! And this includes EVERYTHING! Including installing two servers with ruby, rails and fastcgi. Including database development (which granted was simple). And including reading a whole bunch to figure out how to do it all. About the only thing I had to start with was the web page with the contact form. 10 hours! How can I not be impressed? Given I have everything installed and I know a bit of Ruby and a bit of Rails, I would guess it would only be a 2 or 3 hours to develop this size application again. 2 or 3 hours! Incredible. Rails generates a whole bunch of stuff for you and worries about accessing the database, rendering templates and generally just controlling everything. All with very little configuration. Take the db config. I literally just had to point it at a database. In the code I just had to call save() and Rails figured out how to get the data into the database. It all just works!

Okay, Tim, calm down. It was just a contact form with a couple fields and a single database table. And you had to send an email. Woo. Talk to me when you do something complex.

You are right. But how long would this have taken with a servlet, given the same starting point in Java and Struts? I mean I probably could develop this app in under 10 hours given my experience with Java now, but I can’t imagine doing it if I had no Java or Struts experience at all. Maybe I’m a smart guy and maybe I catch on to things quick, but the speed at which I caught on to this Rails thing, just can’t be justified by my own abilities. There is definately something here that I’m going to continue to look at. I have a much more complicated web app to work on in the coming months and I’m going to try Rails with it and see how it goes. I’ll let you know. For now all I can say is, RubyOnRails is really promising and I haven’t had this kind of reaction to a technology in two or three years.

One Comment

  1. wrote:

    Fixed the link to my applets page for all 24 of you who got 404’d.

    Wednesday, April 27, 2005 at 2:44 pm | Permalink