Ruby on Rails Isn’t Dead
Back in the day, Ruby on Rails (RoR) was hot sh*t and the framework’s success arguably put Ruby on the map. David Heinemeier Hansson developed RoR while he was working at Basecamp in 2004. So it might not seem like that long ago, but in terms of web framework evolution, Rails is old. Like, not even ironically enjoyed by hipsters, old. Therefore, many have argued against its relevancy when there are other newer options available. But just because something is more mature, doesn’t necessarily mean that it’s obsolete.
Why the Rumours?
You might have heard that Rails is in decline. Let’s look at some graphs, shall we?
Okay, so looking at this data we can infer that search popularity on Google and Stack Overflow for Ruby on Rails and Ruby is declining. In comparison, Node is taking off. This doesn’t mean there are fewer sites out there using Rails. Some of the biggest players in the field use Rails like AirBnB, GitHub, Shopify, Etsy, Bloomberg, Twitch, Imgur to name a few. It still has a significant share of the market. Node.js is just slowly carving away at its popularity with the rise of powerful front-end frameworks like React. Rails isn’t going anywhere, it’s just not in the spotlight anymore.
But Should I Bother Learning it?
Whether or not you should learn Rails specifically comes down to a lot of considerations that have nothing to do with its popularity.
Are you asking because you’re looking for a job? If so, your first step should be to research the availability of Rails related positions in your location.
Are you asking because you have a project in mind? Well then, the answer depends heavily on the specifications of said project. But typically when considering a framework, you want to look at:
- The learning curve — how hard it is to learn?
- Community support — how big is the community? Is it well established?
- Documentation — how easy is it to find well-written docs?
- Performance — how fast is it?
- Scalability — does it work well at a much larger scale?
The thing is, when you’re choosing a framework to develop with, you’re also actually choosing which base language to use as well. I will say from personal experience if you are picking your first programming language, learning Javascript before Ruby makes a lot more sense rather than vice versa. Which brings me to my first point in defence of RoR.
The Case for Ruby on Rails
- Ruby is super easy to learn
Having just learned the basics of Ruby and Ruby on Rails, I can attest to the fact that the learning curve for both is small, especially if you have some previous coding knowledge. This is because when Yukihiro “Matz” Matsumoto created Ruby in 1995 he did so with the goal of making its syntax as close as possible to English. So, where Javascript requires heavy use of things like curly braces and semicolons, Ruby has built-in logic to eliminate the need for these which makes both writing it and reading it, super simple.
2. Developing with RoR is fast
Because Rails does a lot of the heavy lifting when doing things like creating and updating a database and routing, its super time efficient. This makes RoR the framework of choice for prototyping and makes sense for lean startups that need to get an app to market asap.
3. There’s a gem for that!
RoR is supported by an extensive collection of modules/libraries packaged in gems. If you can think of it, chances are there’s already a gem for it. Just as Node uses npm, Ruby on Rails uses RubyGems to manage gems.
4. Code Quality
Ruby on Rails was designed to inherently conform to web standards by using paradigms like coding by convention, DRY and active record pattern. The mindset of writing highly standardized and convention-based code permeates the community and enforces strict code quality.
5. Community
Rails is open-source and has a large and well-developed community which means there’s a lot of support out there available if you need help.
6. Continually Evolving
Both Ruby and Ruby on Rails are being updated frequently, which is indicative of the fact that they are, in fact, very alive. Ruby 3, which promises to be 3 times faster than 2.0 is set to be released at the end of 2020. Rails 6.0 was released this past August.
The Case Against Ruby on Rails
- Performance Issues
This is the main issue raised when dissuading people from using Rails. In comparison to NodeJs or GoLang, runtime speed for Rails is slow. Like, painfully slow. Boot speed can take a long time depending on how many gems/files are loaded, but there are preloaders like Spring available to alleviate this issue. This problem becomes way more apparent at a larger scale.
2. Opinionated
Its called Ruby on Rails for a reason. Derailing a train takes an incredible amount of force. By abstracting certain processes from the developer, Rails actually makes deviating from its preset logic, incredibly difficult. At first glance, it appears as if Rails is just magically doing things that manually involve a lot more code. So when it comes down to it, there’s really not a lot of wiggle room for creativity unless you want to as my friend puts it, “write 9000 extra lines and hate your life”.
3. Documentation
Despite the size and enthusiasm of its community, good docs for Rails can actually be difficult to find. This is especially true for certain, less popular gems in which case the test suite acts a clue to the code’s intended behaviour.
4. Harder to debug
The multiple levels of abstraction that make Ruby on Rails easy to use, also coincidentally, make debugging a bit of a pain.
Summary
Is Ruby on Rails the new kid on the block anymore? Heck, no. But that doesn’t mean we have to pronounce it legally dead. Ruby on Rails is here to stay, and whether or not you bother learning it depends on your specific goals. Many people enjoy long and successful careers as Ruby developers. While RoR is opinionated, it makes back-end development super fast so it’s great for MVP and prototyping but can be expensive when scaled because of performance issues. Hopefully, with the release of Ruby 3, we’ll see a significant improvement in speed and this powerful framework will once again be trendy.