Why choose Ruby for your project?
Evrone technical director explains why Ruby is a modern and relevant language
History of Ruby
Ruby, the creation of independent programmer, Yukihiro Matsumoto, began life over 20 years ago. In 2003, Chicago-based 37Signals launched the popular project management system, Basecamp. 37Signals had developed Basecamp in Ruby, and in 2005, they made the web application framework they’d developed — Rails — public.
Thanks to the versatility and ease of use of the framework, Ruby on Rails became the first choice for web application developers all over the world. Airbnb, GitHub and the first version of Twitter were all written in Ruby. Frameworks such as Hanami and Sinatra emerged alongside Rails. In 2006 Ruby placed first in the Tiobe language ranking and maintained that position for another two years.
What makes Ruby on Rails great
Ruby on Rails was one of the first frameworks to use the now well-known Model-View-Controller (MVC) pattern for dividing apps into logical components distinguished by role, rather than general area of functionality. The framework promotes “agreement over configuration”, the result being that projects developed using MVC tend to have a similar basic structure and architecture, easing the transition of developers from project to project.
Rails introduced ActiveRecord, what’s known as an Object-Relational Mapping (ORM) system. Traditional web development involved manually embedding SQL statements into your code when you need to interact with a database such as PostgreSQL, Oracle, and MySQL. Whilst this approach is simple in principle, it’s fraught with complexity in practice, with every query that needs to be parameterized being a potential candidate for attack by malicious parties.
ActiveRecord works differently: it represents your database as Ruby objects, and you interact with them just as you would any other Ruby object. As you read and modify the objects in your code, ActiveRecord takes care of constructing and executing the correct — and safe — SQL queries for your chosen database behind the scenes. No more escaping rules. No more conditional blocks to deal with different SQL implementations. Just plain Ruby code injected with a little magic.
Deployment and testing
The more complex an application, the harder it is to maintain. Fortunately, the Ruby ecosystem comes with a raft of standardized patterns and tools to ease the pain of verifying code quality, constructing and running automated test suites, and updating deployments. Tools such as Minitest, Rspec, Capybara, and Cucumber helped to popularise approaches such as test-driven development (TDD) and behaviour-driven development (BDD).
Development and release cycle
Ruby and the Rails framework are both under active development and regular updates are released for both all year round. Rails 6, released in the second half of 2019, introduced a number of new features:
- Parallel testing
- Working with multiple databases
- Automated e-mail support
- Tools for interacting with frontend technologies
- A built-in system for organizing user file storage
Many of the changes and improvements are made in response to the Rails developer community. For example, there is a number of community-made tools to manage with user-provided files, but none offer the simplicity of being integrated into the framework. According to Github, Rails has the largest number of active contributors out of all language frameworks on the platform.
So, if you choose Ruby and the Rails framework for your new project, you’ll benefit from a large and active community, tons of expert knowledge, and mature tools to help you get up and running quickly.
And of course, Evrone will be happy to help you with all of that!