Ruby Will Make You Happy: An Introduction to a Developer’s Best Friend
What exactly does BFF stand for? There are two choices. It could be an abbreviation for Backends For Frontends or Best Friend Forever. The latter is true for Ruby, the world’s coolest coding language. I’m not going to teach you how to use Ruby in this blog post, as it has already been addressed numerous times in the past. I’d just like to share some fascinating facts about Ruby and its world.
The Origin of Ruby
Yukihiro “Matz” Matsumoto created the Ruby programming language on February 24th. Yukihiro wished to develop an object-oriented scripting language and increase code reuse in order to accelerate development. In one of his posts, he stated:
“I was talking with my colleague about the possibility of an object-oriented scripting language. I knew Perl (Perl4, not Perl5), but I didn’t like it really, because it had the smell of a toy language (it still has). The object-oriented language seemed very promising. I knew Python then. But I didn’t like it, because I didn’t think it was a true object-oriented language — OO features appeared to be add-on to the language. As a language maniac and OO fan for 15 years, I really wanted a genuine object-oriented, easy-to-use scripting language. I looked for but couldn’t find one. So I decided to make it.”
On December 21, 1995, the first version (0.95) was released. Ruby 1.0 was released just over a year later, on the 25th of December 1996, at the same time as the ruby-talk mailing list. The first article about Ruby appeared the following year, on September 22nd.
Ruby on Rails
The most important framework for Ruby was created in 2003 by David Heinemeier Hansson (DHH) and officially released as open-source in July 2004. Ruby on Rails has a multi-layered functional structure with the Model-View-Controller (MVC).
“Rails is the killer app for Ruby”
— said Yukihiro Matsumoto.
Why is Ruby on Rails so popular? It’s ideal for MVP development and it allows for fast programming. It has a strong ecosystem, community and is easy to scale. The current stable version is 7.02, which was released on 8th February 2022.
So far, Ruby has 4457 contributors which made 82861 commits when the most active user tenderlove made 4374 commits to make Ruby on Rails better. Is it a big amount? I think it’s good enough.
What about Ruby conferences? You have time to sign up for upcoming ones, such as Sin City Ruby in Las Vegas, or Railsconf in Portland. Please visit this site, if you would like to find more. If you would like to visit something locally, you can check ruby user groups, such as this one.
What is a Ruby gem? In simple terms, it’s a Ruby’s library that you can include into your code. All gems are collected in RubyGems which acts as the package manager released 14th March 2004.
But how to find a correct and safe gem? It is even simpler than to create a Rails application! Just go to the https://rubygems.org/ or https://www.ruby-toolbox.com/ and search for what you want! You can search by categories, trends, compare it with others — choose what you need best.
Rails for Zombies
On November 18th, 2010, Gregg Pollack, a Ruby enthusiast, together with Envy Labs, prepared a Rails for Zombies online course for Ruby beginners. The main purpose of this course was to teach Rails in an easy and fun way.
At the end of each lesson, students had to complete a coding exercise to access the next one. If you would like to start with Rails, even though this course is based on Rails 4, it’s highly recommended that you dive into this course!
RailsCasts was produced by Ryan Bates. It was a free collection featuring tips and tricks with Ruby on Rails in the form of educational videos with great narration and a clear message. The first tutorial was released on 4th May 2007. Railscasts are not developed any longer, but are still available to see.
Why Is My Code Buggy? RSpec to the Rescue!
As a software developer, you already know that to write good code you have to cover your changes with tests. With Ruby tests, we think about RSpec, the domain-specific language (DSL) testing tool written in Ruby to test Ruby code. It started as an experiment by the Steven Baker team in 2005 and the stable 1.0 version came out in May 2007.
Why Does My Code Look Ugly? RuboCop to the Lint!
I created the code, covered it by specs, but is my code formatted correctly?
Every developer has their own habits, but every language has its own rules? How to be sure that our code style is correct? There is a Ruby code bodyguard — RuboCop! RuboCop is a code linter and a formatter based on the community Ruby Style guide. It has a lot of extensions for all popular Ruby IDE. The first version was released on 21st. April 2012.
Deployment with Heroku
“I’M A SOFTWARE DEVELOPER, NOT A DEVOPS!!!!” Let’s do an experiment. Let’s try to find 10 Ruby developers and ask them what the simplest way to deploy the Ruby app to the cloud is. I’m more than sure there will be only one response — Heroku!
Heroku is a cloud service that allows you to easily deploy, scale, and manage your web service. You have to install Heroku extension on your machine, login into service, and make a few simple commands. Sounds easy right? Helping Ruby coders since May 2014.
This is a collection of Ruby libraries that helps you write more maintainable and clear code. The collection includes 24 gems and was released on 16th March 2016.
Current statistics show that there are 1 174 881 live websites using Ruby on Rails. Day by day we have a lot of updates for the most popular gems. The newest ruby version has been optimised for memory and CPU usage and has added new features such as Typeprof or RBS.
The Ruby community is huge and there are a lot of RoR conferences planned for this year. I can say with total conviction, Ruby is doing well and is not dead!
Words by Artur Kremens, Ruby Senior Software Developer in company Altimetrik Poland.