Why Ruby Still Feels Like Home After All These Years
47 points by Caio
47 points by Caio
I'm going to disagree on "no ceremony RuboCop". There is quite a lot of ceremony in picking and tuning cops, discussing whether new cops added in recent update should be enabled or not. StandardRB is much closer to no-ceremony approach, but there we are - you have to pick one.
Languages with linting built-in have much less ceremony and bike-shedding than Ruby.
I picked Standard for Sidekiq's codebase like a decade ago and haven't regretted it for a moment. Constraints are liberating.
Can't you just use all the defaults? I'm kind of against configuring linters in general, offload these decisions to the community
you can, and its been a while since I have done a lot of Ruby, but the defaults were not to my liking. To the point I found them to be annoying. It's not like I used to gut them but there was always stuff I would adjust.
sure, that's understandable, but my point to the original poster is that you're choosing to do the ceremony at that point
With many linters, yes. With rubocop: no.
Rubocop goes far beyond linting imo and is more like a subset of Ruby. You are programming rubocop.
Does everyone remember how in the movie Robocop, he (and ed-209) was programmed to be way too strict? Or maybe that was just the Bob’s Burger episode, it’s been a long time. In any case, the triumph of Robocop was his human side. So anyway there’s some kind of irony and aptness to the naming, because it’s too much rule strictness.
It’s definitely not “the community”s opinion either. I use standardrb which is a much better set of defaults. A lot of the community seems to agree.
To be frank, I go back and forth on this. On one side, I generally think RuboCop has good enough defaults and we should try to abide by them / evolve them instead of fragmenting coding styles; on the other hand, I do think that it's too opinionated sometimes, and it could use something like standard.rb to put it back on rails (no pun intended). I wrote the article from the POV of someone who would like to learn or come back to Ruby and not have to deal with a thousand gems to write pleasant code.
100%. When Go came out and had one blessed formatting systen I thought that nailed it. Our brains are pattern matching machines and you get used to it and move on. But when there are options, you feel the disconfort. And everyone steers towards this or that.
Problem is, neither RuboCop nor Standard have the authority to do that for Ruby. That should come from the core team, which is not going to happen, because that would go against Ruby philosophy.
I disable all RuboCop cops in my projects and only enable a handful.
Single quotes FTW! 😀
That also made me pause. They seem to call it out in another post: https://caio.ca/blog/coding/my-complicated-relationship - "The Wild West of Code Formatting".
it’s not a simple, built-in solution. It comes with hundreds of configurable “cops,” leading to endless debates about which rules to enable.
I largely agree, but kinda wish refinements weren't the first example.
I do get why someone would like them, but it's one of these things where it's best not to know how the sausage is made. Their semantic is so tricky, that a decade after their introduction we keep finding nasty bugs with them in MRI.
e.g. just in the last two weeks:
And on the performance front they tend to make lots of optimizations harder. And the same thing is happening again now with boxes (even though the jury is still out on those).
the same thing is happening again now with boxes (even though the jury is still out on those).
The box idea seems hard to retrofit on a language where everything has lived in the same global namespace for decades, and not only at the implementation level where I’m sure there’re still many latent bugs, but also in libraries.
I no longer write much Ruby, but I’m curious to see how this takes off. This looks fun. :)
Thank you for posting this. It mirrors my experience too in my "Returning to Rails" post[1], and although it may be confirmation bias, I'm seeing a lot more people re-discovering or appreciating the beauty of Rails code again.
I'm conscious though that there's an interesting phenomena where it's said that your tastes kinda solidify in your 20s/late teens when it comes to things like music and art and so on. I wonder how many of us first encountered Ruby during the "golden years" of Rails (you mention Rails 3 and Capistrano which more-or-less mirrors my experience) and are simply looking at it with rose-tinted (ruby-tinted ?) spectacles & are harking back to that era of our lives ?
I also was deeply immersed in Ruby "shops" and surrounded by Rails developers at that time, so it seemed like it was everywhere to me; It was interesting though to see a commenter on the lobste.rs thread[2] opining that Ruby was really only ever quite a niche language. So maybe there's that at play, too.
But then again, Ruby does still feel like home to me, and it just seems to work the way my brain works. Minimal translation, zero surprises, feels like I'm conversing with a friend rather than trying to write a formal thesis. Still haven't found anything that clicks quite like it and I don't think that's entirely down to a growing "kids these days, get off my lawn" mentality.
Whatever, I'm just happy to see it still going after all these years :) And thanks for introducing me to the "tap / new" chain, that stopped me in my tracks at how beautiful and useful that construct is! Definitely going to be making use of that...
Cheers,
-Mark
PS - I feel bad mentioning this as it's not directly related to the topic, but your AI avatar on your homepage is creeping me out :( It sets off all kinda of uncanny valley "a bot write this" vibes. Whenever I encounter one it always gives me pause to consider whether I'm conversing with a real human :/
[1]=https://www.markround.com/blog/2026/03/05/returning-to-rails-in-2026/ [2]=https://lobste.rs/s/jreqtw/returning_rails_2026
I can assure you, I'm real. I just don't like having my real picture out there, and the avatar is close enough that people who know me in person will recognize.
Great post!
Ruby 3.4 added the it block param, which you could use instead of _1 in your example:
items.map { it.price * 1.1 }
I forgot about mentioning it. Not sure if it's because it's relatively recent, but my muscle memory can never get used to typing it in these iterators.
I loved writing Ruby but the testing overhead just became too much for me. I thought adding some kind of type safety to the language would help but when #{last_job} added Sorbet to our codebase it just killed any momentum (and fun) I had when writing code. This may be an unpopular take but the fact that something like Sorbet exists is more of a smell against Ruby than anything else. Ruby itself is a powerful and fun language but people started using it for tasks it was never designed to do and in the process they started bolting on tools to account for the languages anti-features.
Now every line felt like a total slog and I was spending far more time waiting on various built, test, lint tools than I was actually writing code. That, combined with our over-engineered build & deployment processes, made doing even basic things take ages and made me miserable in the process.
I miss a lot of the Ruby world from 2012 or so. Those feel like great times in hindsight.
What are more suitable languages, in your experience? (When you say "for tasks it was never designed to do" I assume you mean large Rails apps.)
In my case it is the control plane for all of Heroku Postgres/Valkey/Kafka. Ruby worked and the service was stable but there was a lot of uncertainty in changes and clean rspec builds would often lead folks into a false sense of security. Everything was designed to be idempotent with some degree of automated retries but there were plenty of cases where a seemingly safe deploy (code looked fine, worked in rspec, worked on a dev environment) would blow apart at the seams in production because if various undefined/unexpected behaviors, usually around the complex expectations of a hash.
The sheer volume of safe operators and code like unless record.nil? everywhere always felt like a smell to me. Sure having to define structs for everything in a language like Go would have been cumbersome but the more guaranteed levels of safety would have seriously paid off. Sadly the Go ecosystem wasn't as mature when the service was built and most of Heroku was a Ruby shop at the time. We relied a lot on REPLs to do operational insight as well so it makes sense given the time frame. Kinda hard to justify rewriting a 12-15 year old codebase that is critical to the business when said business is already underwater.
I've worked in a few large Rails codebases to varying degrees of success. Some were written really well and had strong standards and easy testability. Others were a mess of various standards and each controller was built to follow whatever design pattern was popular on HackerNews at the time. Not the fault of Rails but the ecosystem certainly went through a lot of back-and-forth for a while, like "skinny controller/fat model", "the concern wars", "presenter hell", etc. I love Rails but for a bit there the answer to every question seemed to be "that code doesn't go there".
The TypeScript ecosystem is growing on me. I'm running a side project built in Express and I don't hate working in that code.
I came back to ruby after 10 years away - in the age of "AI" it's handy to be able to actually grok the code as it flashes past your eyes and actually understand it, and steer/halt the LLM. This is more difficult to do with more verbose languages.
I miss Ruby too. Even more. I miss the very possibility of such a language in everyday production. It was a hope. No, it was the Hope. At least for me and for a long time.
Reads like AI slop. Other recent blog posts too.
I'm not picking up any signs of slop. What are your tells?
(I think that while it's good that we call out slop on this site, we need to avoid false positives and say why exactly we think it's slop.)
I was going to say "It is not just private and public." kind of sounds like "It's not X, it's Y", but that's kind of a reach, and writing "it is" longhand feels like a very human quirk to me.
It didn’t read like AI slop to me. What makes you think that? (I like it when people alert readers to this, but very much prefer that they say why.)
I have fond memories of working in Ruby earlier in my career. There is something really pleasant about it.
When I wrote some Ruby most recently though—maybe last year—I found the web-based standard library docs to be hard to navigate. Am I alone in that? Is there an alternative to the ruby-lang.org docs?
I'm extremely jealous of Ruby blocks. I really think Python would benefit from a mechanism like blocks, but I don't think it would really ever get in because of the (extremely fair!) points about it not being necessary and also it not really being a "regular" argument passing mechanism (since, IIRC, Ruby blocks have the be the last arg).
But there'd be so many nice DSLs possible if you could inline declare your "lambda". Right now people use with for a subset of things but it's very limiting.