The one about learning Ruby


I started working with Ruby in early 2010, on projects developed with Ruby on Rails. My mentor was influential enough to convince our bosses that this programming language and this framework were the best choice for future projects. We usually worked with CakePHP, so understanding how Rails works with the MVC pattern was really a piece of cake. Got it? Never mind...
15 years later, I work at SNGULAR, which is a consulting firm that mostly works with Java and its ecosystem in the backend of their software development projects. They also have projects with popular languages such as PHP or Node.js, among others. Focusing exclusively on what they call the Backend chapter, each of these technologies has an internal learning path defined. This is not the case with Ruby, since they do not have many projects where this is the main programming language.
When I started working at this company I was already assigned to a project, but as I already had booked my vacations, my start at the American fintech was delayed for a few weeks until I was back.
I had several weeks ahead of me before leaving, so in addition to completing my onboarding, my boss proposed to do a Ruby training to some colleagues who did not have a project assigned at the time. All of them were experienced developers who were used to work mainly with Java or PHP, but had no previous experience with Ruby. I accepted without hesitation.
You will find below the guide I shared with the company to learn Ruby, to which I have been adding some stuff that I consider interesting during the last months.
Ruby Training
Recommendations
The most important recommendation is always learn Ruby first and then learn the framework of your choice if needed, usually the most popular. This is applicable to any ecosystem. That way, when you work on a gem, a script or anything else where you do not have available any of the libraries provided by the framework, you will be able to work with Ruby pretty easily.
Even if you already have experience with this language, I recommend you to access this quiz and you will probably understand what I mean.
Another recommendation that I consider important is that you look at the version of Ruby used in the articles and documentation that you find, because some things might be outdated. On the official website you will always find news about the latest versions released.
Documentation
References in the community
Not an exhaustive list and in no particular order:
- Yukihiro Matsumoto "Matz"
- Sandi Metz
- Janko Marohnić
- Nate Berkopec
- Avdi Grimm
- Katrina Owen
- Aaron Patterson
- Mike Perham
- Akira Matsuda
- Rafael França
- DHH
- Thoughtbot
- Evil Martians
- Shopify Engineering
- GitHub
Key concepts
Going beyond the most basic concepts present in every programming language we can find the following concepts:
- Global Interpreter Lock (GIL):
- Concurrency vs parallelism
- Threads vs Fibers vs Ractors
- YJIT:
- Ruby is an interpreted language
- The JIT allows to dynamically compile Ruby code into machine code at runtime without interpretation
- Improve performance and memory usage
- Types:
- Debugging:
<object>.methods.sort
: what methods an object respond to.<object>.method(:<method_name>).source_location
: where is defined a certain method.<object>.method(:<method_name>).super_method.source_location
: where is defined certain method with the same name in one of the ancestors.
- Metaprogramming:
define_method
- Always define respond_to_missing? when overriding method_missing
send
vspublic_send
- Monkeypatching
- Exceptions:
- Pattern matching
- Shorthand hash syntax
- Safe navigation operator (&)
- Strings (
to_s
) vs symbols (to_sym
): - Classes vs modules
- Lambdas vs procs vs blocks
- Memoization:
- Logical operators:
and
vs&&
or
vs||
not
vs!
- Namespaces
- Inheritance
- Constants lookup
super
self
- Attribute macros:
attr_reader
vsattr_writer
vsattr_accessor
- Variables:
- local vs global vs instance variables vs class instance variables vs class variables
- Methods visibility:
- public vs
protected
vsprivate
- public vs
- Regular expressions:
- Documentation:
Frameworks
Testing
- Frameworks:
- Articles:
Interpreters
Installation
- In a real project, whenever possible, it is recommended to use Docker containers.
- Version managers:
- GoRails setup
Editors and IDEs
You will find plugins for Ruby in any editor/IDE.
Linters
Style guides
Playgrounds
Courses
The company provide us with access to the courses catalog available on Udemy.
Some interesting courses to start learning Ruby and Rails:
- Learn to Code with Ruby
- Testing Ruby with RSpec
- The Complete Ruby on Rails Developer Course
- How To Build Instagram Clone Using Ruby on Rails 7
Not yet available for us, but hopefully will be soon:
Other courses:
Videos
- Ruby conferences
- Upcase
- Drifting Ruby
- GoRails
- Railscasts (outdated)
Books
- The Pragmatic Bookshelf: lots of books could be outdated
- Practical Object-Oriented Design: An Agile Primer Using Ruby (POODR)
- 99 Bottles of OOP
- Ruby Science
- Painless Rails
- The Complete Guide to Rails Performance
- Testing Rails
Newsletters
Exercises and katas
Interesting websites and articles
- PHP to Ruby
- RubyGuides
- Design Patterns: every pattern includes examples in Ruby
- GoRails guides
- Rails hurts
- Upgrow: A Better Architecture:
- Proposed by Shopify and somehow inspired by DDD
- Bear in mind that this is not a usual approach in a Rails project
- How to train senior developers in Ruby on Rails
- GitLab: Why we're sticking with Ruby on Rails
- Writing Less Error-Prone Code
Useful and popular gems
- RubyGems: Find, install, and publish Ruby gems
- Awesome Ruby: A collection of awesome Ruby gems, tools, frameworks and software
- The Ruby Toolbox: Find actively maintained & popular open source software libraries for the Ruby programming language
Some gems are available for any Ruby project and others are only available for Rails:
- Testing:
- Next generation:
- dry (dependency injection, types, schemas, validations, monads, ...)
- Web servers:
- Rack (Interface)
- Application servers:
- CORS:
- Databases:
- Migrations:
- Bulk imports:
- Cloud:
- Background jobs:
- Events:
- Cron:
- WebSocket:
- Uploads:
- Caching:
- Dalli (Memcached)
- Full text search:
- HTTP client:
- APIs:
- Deployment:
- Geocoding:
- Feature flags:
- Authentication:
- Devise
- Doorkeeper
- Omniauth: Standardized Multi-Provider Authentication
- Clearance
- Authorization:
- Mobile:
- Templates:
- Assets:
- Interactivity:
- Views:
- Forms:
- Pagination:
- State machines:
- Videos:
- Money:
- Audit changes:
- Dependency updates:
Community
Last but not least, get involved in the community the way you prefer. Follow people in social networks, read as much as you can about the language, its frameworks and tools, and even collaborate in open source projects if you feel like it.
In your city probably there is a Ruby group that gathers from time to time, usually monthly, to talk about the language and related stuff. For instance, in Madrid, where I am currently living, we have Madrid.rb.
That training for me was an enriching experience that took about 4 weeks. My colleagues approached the training as a challenge and at all times I felt that they were really interested in learning the language and its ecosystem, and that they wanted to put into practice what they were learning.
My boss told me that they were very happy with the training and I can confirm the guide I created will be used for future trainings at SNGULAR.
I would also like to take this opportunity to thank my mentor, Eddy Josafat, for coming up with the brilliant idea of using this language in which he saw a promising future. He was not wrong.
By the way, this is a list that I will keep updating over time. Is there anything you miss in this list? If so, leave it in the comments, please.
Thank you for reading and see you in the next one!
Subscribe to my newsletter
Read articles from David Montesdeoca directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

David Montesdeoca
David Montesdeoca
I love learning new stuff, especially when it comes to building software. I'm really interested in software architecture, clean code, testing and best practices.