A week from today, on Christmas (Th Dec 25, 2025), Matz will be releasing Ruby 4.0, the next major version. The article below reviews some of its new features.
The new method that I would use to replace existing code is Array#rfind.
Despite their verbosiness (?) I find a common set of parameters more intuitive and useful than having different methods for different options. And where is #rreduce btw?
I wonder why. I am sure reverse_each.find optimizes that, so it is not slower than rfind (that’s why the _each part is on there). So it is just to save characters typing? Maybe they should have called it dnif and save another character.