6 Comments

My Experiences with Ruby off Rails

Ruby Off Rails

I was recently pointed to Ben Singelman’s post on Why Nobody Should Use Rails For Anything, Ever.

We seem to never get enough of arguing about application frameworks: I’m not going to do that. What irks me is when Ruby get thrown out with the Rails bathwater. As one commenter on Singleman’s post demonstrates:

“Interesting perspective. I agree on your general points — Ruby’s fine at an MVP stage I think, but when it comes to creating something for market, it just falls over.”

(This despite the second sentence of the post stating “Independent of ruby, I see Rails as the emperor with no clothes on.”)

I see posts like this a lot. It’s an opinion piece — the goal is to sway the reader to have the same opinion. Like many similar posts, the title is hyperbolic, the conclusion a tad more pragmatic. Which is fine. I read it because we write a lot of web apps at Atomic, and we frequently choose Rails. I wasn’t reading to learn facts about Rails, and I wasn’t disappointed. But it did get me thinking about my time with Ruby: most of it was not using Rails.

Don’t pick on Ruby just because you don’t like Rails

Despite making use of Ruby since 2004, I’ve never personally written a Rails app for a customer.

I was an early advocate for Rails, discovering it in 2005 and attending RailsConf in 2007. I’ve built Rails apps occasionally in my spare time, for my own use, mostly to keep up with major changes since 1.x days. I helped estimate a project that was eventually written with Rails. I’ve helped upgrade and maintain a few apps that we use internally at Atomic (and even some we sold as pre-packaged CMS-a-likes, circa 2005.) I’ve written many web apps (at least a handful that used Sinatra) and a lot of Ruby apps.

On my current project, we sort of tried to use Rails but ended up using just the asset pipeline to make an Ember app backed by a Grape API. (Our app/models directory still has a .gitkeep in it.) Rails just wound up being marginal and superseded by other, more loosely-coupled components.

Today I wouldn’t reach for Rails as my first choice in writing a web app either, although maybe not for the same reasons as the article above. But I love using Ruby.

Language and framework wars aside, there are many other ways to make Ruby useful

I usually recommend people who are steering towards Rails to try using it with JRuby first, as supported by a relevant opinion in the Hacker News discussion for Ben’s post.

That detail aside, here are some of the more diverse examples where I’ve used Ruby that didn’t involve Rails:

  • A scrappy SQL Server scripting tool using Ruby 1.8.0, ODBC, and Cygwin. Yay “scripting languages”!
  • A business rules engine running inside a Java app on a big enterprise J2EE container. JRuby and Cucumber were critically useful here.
  • A couple of JRuby/Swing/SVG desktop applications with complex graphical simulation interfaces
  • Sinatra web app using Sequel for a medical industry customer. (I think it was later converted to Rails… C’est la vie!)
  • A make-like build system for a large C++ project on Mac OS X, Linux, and Windows. This was before Rake was very useful…
  • An iPad app using ReactiveCocoa and… RubyMotion!
  • A system test suite for a pure-Javascript app—using Celerity
  • Routing the status of an internal continuous integration system to a giant MDOT traffic light hanging in our office
  • Messing with cross-platform 2D games in my spare time

Even with so many exciting alternatives I still use Ruby today. It’s a wonderful tool but remember that Rails isn’t the only way to wield it!