Stick to your knitting

Why is Ruby on Rails a great choice for your startup or new web application?

Ruby on Rails, once the darling framework of startups everywhere, has in recent years fallen out of the spotlight due to the amount of heat and noise generated in JavaScript frameworks. Nonetheless, Rails has stuck to its knitting and is better than ever for web application development. Rails remains the most productive framework for taking care of the common stuff and letting developers focus on what’s unique about the application.

First, let’s get our biases out of the way, we’re an agency that specializes in Ruby on Rails, and between us we’ve worked on over 3 dozen Rails applications, ranging in size from the teeny to the titanic. We’ve used other frameworks over the years but we keep coming back to Ruby on Rails.

Why use a framework at all?

Frameworks and their surrounding ecosystems of software libraries provide off-the-shelf solutions for what’s commonly needed in a web application and allow developers to focus on what makes your application unique. Frameworks evolve and so do the productivity gains they bring. Extending and supporting a web framework isn’t a core competency of your business so it makes sense to leverage the open-source contributions of individuals and organizations that will maintain and improve the framework for you.

That said, adopting a framework comes with an unspoken contract that not all business owners may be aware of, and that’s that the framework will require regular updates. These updates fix security issues, keep compatibility with the underlying software, and leverage improvements in web browser technology. It’s wise to reserve some budget for this inherent tech debt that accumulates with the use of a framework.

How to evaluate a framework?

Match with your project requirements

What you want to build is the biggest factor in determining what framework might suit your project best.

For example, if your site is static (i.e. doesn’t change often) it may not make sense to use a server-side rendering (SSR) framework that will dynamically render each page. Static sites are faster than SSR frameworks and the infrastructure and hosting required will be simpler and cheaper (free!).

Astro and Eleventy are popular in the JavaScript ecosystem; Hugo is a mature Python site generator; and in the Ruby world we’ve lots to choose from with Bridgetown, Jekyll, Middleman, and Sitepress (we’ve used Middleman and Jekyll in the past).

If you want a mobile app with app store discovery and distribution for iOS or Android you may want to author it in React Native or NativeScript which have near-native performance.

Beware of the current hype cycle in JavaScript frameworks with Single-Page-Apps (SPA). Frameworks like React, Angular, and Vue.js are capable of creating incredible dynamic user experiences in a browser. Their popularity has made them the default choice for building new web applications. SPA frameworks are the right solution if you have a highly reactive user interface and want to build a web application that competes with desktop apps. Examples of highly reactive apps are video games and photo editing tools where you don’t navigate from screen to screen much; you’re actively working on the same screen and manipulating something. Yet SPA apps are often used for applications for which they are a poor fit. If your site has a lot of unique URLs (think user profiles or product pages that you want indexed by search engines) then a SPA framework will be working against you and be a more complex (read expensive) solution than a server-side rendering (SSR) framework. SPA apps have terrible performance on first load as well, they need to first download a lot of JavaScript and then must make multiple network requests before they show anything useful on the page. SSR frameworks serve pages that are ready for interaction with much sooner. In web performance terminology, the Time-to-Interactive (TTI) metric plays a crucial role in user experience. Users are less likely to leave the page and more likely to complete the desired action with a lower TTI. Ironically there is now a movement within JavaScript frameworks back to server-side rendering to regain the performance benefits and simpler architecture.

SSR frameworks like Django (Python), Laravel (PHP), and Ruby on Rails (Ruby!) are all reasonable choices if you are building a web application to be accessed in a browser. As you may have guessed by the title, we’re going to try and convince you why Rails is a better choice.

Development speed and productivity

Ruby, the programming language behind Rails, is known for its elegant and readable syntax. Rails leverages Ruby’s expressiveness to create clean and human-readable code, making it easier for developers to collaborate and maintain projects.

Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write.
Robert C. Martin
Clean Code: A Handbook of Agile Software Craftsmanship

Rails has a pattern of using convention over configuration, which means that if the developers stick with Rails conventions a tremendous amount of stuff will “just work” without much effort. Rails is a complete framework for web application development, it really “does it all.” Rails optimizes for developer happiness, much like the raison d’être of Ruby itself and this design goal leads to enhanced productivity.

Rails encourages the practice of Test-Driven Development (TDD) with built-in testing tools. This approach helps ensure code quality and maintainability by writing tests before writing the actual code.

Community and support

Rails has a thriving developer community who are there to help. The Rails project has more open-source contributors than either Django or Laravel.

Security

Rails includes built-in security features to help protect web applications against common vulnerabilities, such as SQL injection and Cross-Site Scripting (XSS), it also has support for Content Security Policies (CSP).

Performance and scalability

Interpreted languages like Ruby are often perceived to be slow, but the Ruby community has made great strides in addressing Ruby’s performance. Constant iterative improvements with each new release of Ruby and innovation with just-in-time compilation and concurrency have led to substantial performance gains. Rails also continues to innovate, recently improving the serving of static assets like images, CSS, and JavaScript; and adding “Turbo” which speeds up page navigation.

Rails has been criticized in the past that it doesn’t scale. Much of that criticism coincided with the troubles that Twitter encountered when scaling, and Twitter had been using Rails at the time. Today there are many companies using Rails successfully at scale. Companies like Airbnb, Github, Kickstarter, Shopify, and SoundCloud use Rails to deliver incredible experiences to millions of customers every day.

  • Airbnb
  • Github
  • Kickstarter
  • Shopify
  • SoundCloud
Companies using Ruby on Rails at scale

Closer to home, Vancouver has two successful companies, Clio and Unbounce that use Ruby on Rails at scale.

In the end, there are many considerations when choosing a framework for a new project, not the least of which is what your team is already comfortable with. Rails has proven its worth for our team for greenfield startup apps to successful SaaS juggernauts.

Hands knitting a round

It can be tricky to get started, let us help you get underway, contact us today.