Post #1526784
2026-04-22 13:11 UTC
Another rubocop/standardrb gripe:
Style/EmptyLiteral: Use hash literal {} instead of Hash.new
Nah, I have my own heuristics for when to use which one. If it's inside a block with braces, I assert that:
# the "approved" butthole syntax
let(:params) { {} }
looks worse than
# ain't nothing wrong with this
let(:params) { Hash.new }
#rubocop #standardrb #ruby
Replies (3)
-
@soulcutter@ruby.social 2026-04-22 13:13
I wouldn't reject somebody else's PR that uses the butthole, but if I write Hash.new who the hell has a problem with that? Assholes, and rubocop.
-
@gregw@mastodon.world 2026-04-22 15:13
@soulcutter it didn’t bother me before, but now I will never unsee this haha.
-
@hejsna@ruby.social 2026-04-22 17:40
@soulcutter is… is the butthole syntax a common term, like the bacon cannon or the Elvis operator? Or did you just invent it? Because I am 100% here for that