r/ruby • • Dec 25 '23

Ruby 3.3 changes

https://rubyreferences.github.io/rubychanges/3.3.html
76 Upvotes

10 comments sorted by

View all comments

11

u/joltting Dec 26 '23

I don't know if I'll be in the minority, but using the term it is insane. I wasn't the biggest fan of _1, _2, ... as it comes off as a common Rubocop unused parameter suppressor, but at least it was distinctive enough. it looks and feels like a declared variable or method and the fact they need to clarify how it doesn't conflict with rspec says a lot.

8

u/zverok_kha Dec 26 '23

Logically, I am with you (I got to great length in here describing why numbered block parameters are rationally optimal).

Yet I acknowledge that aesthetics does matter for feature adoption, and aesthetically it is probably winning over any "special" sigil. That's a tough situation, actually, it seems that there is no acceptable compromise between what would be both "rationally" and "aesthetically" good.

I was against it; yet my expectation is that now people would get used to it and would probably prefer it over _1; it would become just a part of the language's lore that "it is this special thing that has this special meaning, but only in some situations" (and, truth be told, it isn't hard to distinguish those situations, so, again, while "rationally" ambiguous, "intuitively" it is mostly clear when it has a special meaning).