First impressions on Ruby on Rails

Tags:

In my job at Ribbon, I’ve been using Ruby on Rails a lot – that is what the Ribbon service is built with afterall.

This has been my first time working with Rails, so read on for some thoughts.

Ruby

The Ruby language itself seems rather easy to pick up. It wasn’t just my first time working with Rails, but also with Ruby.

Despite this, I was able to get started rather quickly – much faster than I initially anticipated.

I had some experience with CoffeeScript which seems to share certain aspects with Ruby, such as the optional braces around function calls and such, so although some parts of the syntax looked a bit odd, it was quite obvious from the get go.

Ruby seems to be a quite expressive language, with some things reminding me of JavaScript and Python. You can easily use lambda functions for processing lists and such, which is something that’s quite convenient. The syntax is quite easy to learn although the fact it seems to permit several odd ways of expressing things may require a mutual agreement for developers to stick to a certain coding style. For example, I’m personally not a big fan of the following style (which is allowed in Ruby):

do_something if x > 1

Instead, preferring…

if x > 1 do_something end

Manging dependencies in Ruby seems quite familiar having used npm and composer – the gem system and bundler package manager work in rather similar ways.

One of the nice things appears to be that there seems to be gems (libraries) for pretty much anything you would want to do, and most of them seem to have quite okay quality too.

Rails

Coming from other MVC/MVC’ish frameworks, Rails is quite familiar. You have your routing setup, controllers, views, models and all that.

So starting off with it with having experience in things like ZF, Django and Yesod, it’s pretty easy. It probably helped Ribbon already had a decent amount of code I could stare at to get a better understanding of how to do things, but overall Rails seems pretty simple to work with, and there’s plenty of info available just a Google search away.

Rails as a framework perhaps somewhat reminds me of Django – it seems to be a quite productive framework, in that most things you would want to do are very straighforward and you don’t need boilerplate code (something which has been a big issue for me with Zend Framework 2, pretty much why I’ve avoided it entirely).

Other things

I’ve ran into several annoyances in setting up certain gems, such as capybara-webkit and nokogiri. I think partially it’s because I had some crazy jumbled up mess of libraries on my Mac (I had macports and fink both set up) which I somewhat managed to untangle by starting from scratch with Homebrew.

Overall, I’ve had a quite positive experience with Ruby and Rails so far. I’m far from an all knowing expert but I easily get things done with them.

I don’t know if there’s really anything in the Ruby/Rails combo to warrant switching from some other languages to it though. For example, in Python there are similar tools available, and with Node it’s the same. However, I can’t argue the fact that Rails seems to be very suitable for quickly developing web applications and if you feel your current set of tools is limiting you with that regard, do give Rails a look.