4 ms·
I like strongly opinionated formatter/linters like black for Python, but I'm not fond of bogus justifications: > Single-quotes don’t support interpolation but
by dragonwriter 6y ago
I like strongly opinionated formatter/linters like black for Python, but I'm not fond of bogus justifications:
> Single-quotes don’t support interpolation but aren’t any more performant, so mixing single & double quoted strings adds a bit of cognitive overhead with zero discernible benefit
“I can express things that would be interpreted as interpolation in a double-quoted string without escaping” is a discernable benefit.
“I can use literal double-quotes without escaping” is also a discernable benefit.
(Incidentally, this is a case where the justification also makes it unclear whether they've misdescribed the piece they are justifying: the say it requires string literals to be double-quoted but the justification refers only to single- and double-quoted strings. So, does it only ban single-quoted strings, or does it also ban Ruby’s other 6 forms of literals that resolve to strings?)