The Modern Rubyist: When and How to Use the Latest Features
Lucian Ghindă • September 13, 2024 • Sarajevo, Bosnia and Herzegovina • Talk
Explore how Ruby has evolved with features like numbered params, endless methods, and pattern matching. Let's embrace these changes to future-proof our code rather than sticking to old habits. You will learn how to use the new features, when to apply them, and when to avoid them.
There are almost 5 years since we started seeing many new features and syntax being added to Ruby, and still, a huge part of the developers are not using it. We have become conservative and thus this is a protecting position and when we focus on protecting what we have, we close in and are not focused on evolving and the future. As Matz says in a talk, we need to push forward and adopt new features if we want to avoid the Boredom Trap, where existing developers are getting bored and moving out while new people are not coming in as the language does not evolve to offer new solutions to new problems.
Ruby has evolved a lot since Ruby 2.7 and has added a wide range of new features that can transform both how we think about and write code.
You may have heard about some of them: numbered block params, endless method definition, hash literal value omission, pattern matching, object shapes, or new stdlib/core methods and classes. These features hold immense potential, yet most codebases do not take full advantage of them.
The primary outcome of this talk is to show developers practical knowledge about the new features. They will not only understand what these features do but also when it is a good idea and a bad idea to apply them. It might be that everybody knows about these new features, but adopting them takes work to convince colleagues about the benefits and use cases where new features fit.
In this talk, I will review a series of code snippets taken straight from production and see how they can be improved using the new Ruby features while extracting rules or guides about how and when to apply them.
EuRuKo 2024