Why Ruby Still Feels Like Home After All These Years

https://lobste.rs/rss Hits: 43
Summary

I have been writing Ruby for more than fifteen years now. Started back when Rails 3 and 3.1 were current and everyone was still figuring out how to deploy with capistrano. Back then I chose it mostly because it felt pleasant to type. All these years later, after switching between languages for work and side projects, I keep coming back. Ruby is not the fastest or the trendiest, but it still feels like the one I reach for when I actually want to enjoy the work. There are pieces of the language that rarely get mentioned in the usual pitch, yet they quietly remove friction every single day. Take the way Ruby handles method visibility and refinement. It is not just private and public. You can open a class in a very contained way with refinements and only affect the code inside a single file or block. It is perfect for those moments where you want a little syntactic sugar without polluting the whole namespace. I use it often for test helpers or internal DSLs in larger codebases. module QuotingRefinement refine String do def quote "\"#{self}\"" end end end using QuotingRefinement puts "hello".quote # only available where we called using Another hidden gem is how delegation works with Forwardable or the SimpleDelegator in the standard library. You get clean delegation without manually writing wrapper methods or pulling in extra gems. require "forwardable" class UserRepository extend Forwardable def_delegators :@connection, :query, :transaction def initialize(connection) @connection = connection end end Or the even more ergonomic approach with delegate in Active Support when you are already in Rails, but the core version keeps things light for plain scripts. Ruby also has Object#then and Kernel#tap that let you chain operations in a way that reads top to bottom without intermediate variables. User.new(params) .tap { |u| Log.info("Created #{u.id}") } .then { |u| u.normalize!; u } .save Numbered parameters in blocks from Ruby 2.7 onward remove noise in short callbacks. items....

First seen: 2026-05-20 04:32

Last seen: 2026-05-21 23:08