ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

I continue to just not *get* Rubocop, StandardRB, etc.

Rubocop enforces many rules, often badly-considered rules, and adds new rules frequently.

But I get the impression that other people are genuinely bothered by reading code with a variety of quoting styles? Like, there are enough styles out there, and I read enough different code, that to me that's just a sunk cost.

Maybe other people rarely read outside their 'home' codebase?

I mention quoting styles specifically because when I asked folks what Rubocop rules they thought were particularly helpful... Mostly, the answer seems to be no particular rules, they just want things to be uniform.

The exception is rules about quoting strings, which got mentioned by far the most of any specific rules, but sometimes in specifically-trolling ways.

So apparently it's not that any specific rules are good, but if we could avoid variety in string quoting... Something good happens?

@codefolio most people appreciate predictable structure and work faster with consistent code. Most people work in a single codebase for years. Getting a group that works on one app to agree to a set of rules is time consuming and prone to poorly-considered rules (because it's largely zero sum and because they likely lack experience making those decisions, respectively).

Standard exists to solve this. Consistency without costly consensus building. Consideration without careful decision-making.

@searls Fair enough. I just don't have trouble reading a variety of codebases.

Which is good, because it's been many years since I've had a job that didn't require that weekly-or-more.

So then presumably other people *are* significantly bothered by inconsistency in whitespace and quoting.

But sure, I agree that getting a group to agree on a style guide and then use it consistency is very hard, and most style guides are awful.

@codefolio I don't "have trouble" reading a variety of code styles. Nor do I have trouble using either of metric or SAE socket wrenches. But if you mix them together arbitrarily, it's going to take me longer to do the job.

I see meaningless inconsistencies in code the same way.

@searls @codefolio regarding string quotes: I don’t have a problem reading them if they are different. But consistency is relaxing.
Minor inconsequential differences get distracting over time and train you to ignore differences. That’s bad when differences mean something.

@searls @codefolio Choosing to standardize on a string quotation that only works without interpolation and must be changed if you decide to interpolate is absolutely ridiculous and I can’t believe people blindly accept it from rubocop.
I will die on this hill.
Sorry. I know that’s a digression from the conversation but I’m just astonished that single quoted strings are what rubocop decided was good.
If I decide to interpolate then I ALSO have to change the string delimiter!?

@saturnflyer @searls @codefolio I'm 100% convinced this is caused by utterly outdated notions that single-quoted strings are faster/more efficient when they have not been for at least over a decade.

Perfect example of this: stackoverflow.com/questions/18

But worse than what you describe is my early days watching "senior" Ruby developers use backslashes in single-quoted strings to do interpolations without having to switch to double-quoted strings.

I just... could not.

Stack OverflowIs there a performance gain in using single quotes vs double quotes in ruby?Do you know if using double quotes instead of single quotes in ruby decreases performance in any meaningful way in ruby 1.8 and 1.9. so if I type question = 'my question' is it faster than qu...

@olivierlacan @saturnflyer @searls They're not faster these days, no. They're *really* not faster in Rails, where you have Bootsnap and parse-time isn't a thing at all, full stop.

I can understand the argument that you'd want to see whether interpolation occurs, as a human thing.

But yeah, optimising Ruby for fast string parsing would be really, really silly even if it worked, and it doesn't.

@codefolio @olivierlacan @saturnflyer @searls I'm not sure they've *ever* been faster in Ruby. They were only briefly faster in PHP many moons ago and that was because PHP didn't even construct an AST

Noah Gibbs

@sgrif @olivierlacan @saturnflyer @searls Fair. By the time I knew of anybody testing they were clearly not faster, but no clue about, say, 10+ years ago.

But yeah, wouldn't surprise me if they weren't faster then either.