In this post: why Ruby? why Rails? why not? It sort of fizzles out at the end.
First - a quick definition. What is Ruby on Rails? Ruby is a programming language. Ruby on Rails is a framework for developing modern, database driven web-based apps that is written in Ruby. To grossly generalize - the framework takes care of the common tasks that are part of developing a working webapp - responding to URLs, rendering pages, usually communicating with a database.
People are often curious about why I chose Ruby on Rails for Ravelry. The truthful answer? Prior to Ravelry, I spent 6ish years developing web applications with Java (specifically Struts and then Struts 2) and the fun was gone. Java as a language had become old hat and the Java web application development community felt fractured, tired, and underenthused. I just wasn’t having any fun. I started working on Ravelry because I thought that it would be an interesting and enjoyable project and Ruby on Rails looked like it would take away drudgery and give me some of excitement. It definitely did - I love working with both Ruby and Rails and I’m glad that I made that decision.
There are lots of reasons to choose Ruby and Rails for your next web project. The short response? Productivity and Fun.
Ruby is beautiful
The Ruby site includes the caption: “a programmer’s best friend”. I couldn’t agree more. Working with Ruby has made programming fun again. Ruby code is fun to write - it is terse, flexible, pretty, and natural. If I need to write a bit of code to solve a general problem (outside of any work that I am doing) I always pick up Ruby first.
Matz, creator of Ruby, often speaks about Ruby and feeling:
“Instead of emphasizing the what, I want to emphasize the how part: how we feel while programming. That’s Ruby’s main difference from other language designs. I emphasize the feeling, in particular, how I feel using Ruby.”
Check out why’s (poignant) guide to ruby for a fun introduction to the language.
Rails is smart
Ruby on Rails understands the needs of web application developers and this understanding has saved me massive amounts of time. Without Rails I could have wasted a lot of time with unnecessary SQL, overly verbose and complex views/pages, ugly XML configuration files, clunky code… Rails is designed to feel like a specialized language for building software for the web and it shows. Common tasks are made easy and Ruby (the language) picks up the slack if you need to move outside of the real of the usual.
There is no way that I would have been able to develop Ravelry with the same speed and ease without Rails. There are now many Rails-like frameworks for other languages - a testament to how many things Rails got right.
thriving community
The Ruby/Rails communities are very active and very engaged. It’s a great place to be - there are so many interesting things going on that it’s hard to keep up. Very active projects, tons of great Ruby blogs, all kinds of books and other documentation. The huge community of enthused Rubyists is a very valuable thing.
I check http://del.icio.us/popular/ruby and http://del.icio.us/popular/rails daily so that I can keep up on all the cool Ruby and Rails related stuff that is going on in the world.
scaling is easy
Ravelry moved from a slice of a server to a full server and then on to 8 virtual servers with no architectural changes. Ruby on Rails doesn’t scale for you, it just leads you into building a scalable application from the beginning.
…and of course, there are downsides. These aren’t issues for me, but they may be for you:
more resource intensive (downside)
Your Ruby on Rails app is going to need more CPU power and more memory than an application written with PHP, Java, etc. You’ll need the CPU for Ruby - it is not as efficient as other languages (yet) and will suck up more processing power. The memory is for your Mongrels. Mongrel is one of the best ways to run your app (I guess you can call it an “application server”) and you typically have to run many Mongrel instances because each can only handle one request at a time. 10 Mongrels could easily cost you 1 GB of memory.
always on edge (downside)
If you don’t feel comfortable running the latest and greatest code (think brand spanking new code checked out from Subversion) and keeping up with what is going on inside the community, you may miss out on many of the benefits. Things change very quickly in Rubyland and you’ll get the best experience and the best information and documentation if you come along for the ride.



Comments (6)
Oops, so the question I forgot to ask in my last post is about the UI. Part of my job is manager of online user experience work (usability testing, etc.). Did you do anything formal for Ravelry or do you rely on user feedback? Any plans for formal testing/assessment of the site?
P.S. Virtualization is wickedly cool. I can’t believe you’ve got 16GB of memory in your servers!
Hi Jenn,
Nope - we didn’t do any formal usability testing. Hopefully it isn’t too obvious
Jess and I use the site a lot ourselves and we are constantly noting changes and
improvements that we believe would make our own user experience a little smoother or nicer. We tend to apply those changes from time to time and see how people
react.
Generally things go well. Once in a while, feedback is mixed (this has happened 2 or 3 times) and we have to force changes that we believe are for the better. Sometimes people that have been using Ravelry for many months start to develop a resistance to change
I had planned on using CrazyEgg.com’s click heatmaps to gather some information from the live site but I haven’t had a chance yet. The site is still pretty unpolished in lots of places and often far from my vision, so I haven’t really tried to sit back and look at things from “all users” point of view yet..
Hey casey, i don’t know anything about ruby on rails, since the last time I programmed a real database was back when Netscape was the hot new browser. But I just wanted you to know that I have really been digging Ravelry (when Larissa manages to get off of it) from the point of view of data. Ravelry is such a classical kind of exposition of the relational database idea — different concepts and levels of detail, tied together by common fields. I feel like it should practically be a textbook example of how functional and flexible relational schemes can be. I also really like the way you let people pull in stuff from outside sources like Flickr and blogs, instead of trying to create a whole new environment that demands they duplicate that stuff. The user interface screens bring a lot of info together without being ugly. All in all, it’s a very nice production. Cheers! -Martin
A huge THANK YOU, Casey, for starting this blog and especially this post! You convinced me to switch from Drupal to Ruby on Rails for my current web development project. And I’m having a blast! Keep it coming, everything you’re writing is fascinating.
Maria (Who is (im-)patiently waiting for her Ravelry invite.)
It’s worth noting that Mongrel itself is capable of handling many connections; the problem is that Rails has a big mutex that makes Rails (effectively) only able to cope with one request at a time. One of the major motivations for Merb was to show that Rails could be done with a much smaller lock, and therefore better parallelism (although it can still only leverage one CPU, of course).
Great series of posts here. I’ve still not found the thing I care about to generate widespread use, but I can relate in terms of building something that you care about, that’s fun, and popular. More gratifying than any day job could ever have.
It’s funny that in .NET our tools and toolbox keep getting better, and I wish we could get more ex-Java folks to come our way. We even have an MVC framework now coming for ASP.NET, which has some great potential in a lot of situations.
My girlfriend loves the site. Well done.