Closed jandudulski closed 9 years ago
ul
element. UX anti-pattern (no bullets on mobile)... just saying.Single quote should be for Char data type, (which does not exist in ruby but do in Elixir!) so I'm for double quotes in ruby everywhere :) On Tue 23 Jun 2015 at 21:30 Michał notifications@github.com wrote:
- It's rather a style guide thing not an anti pattern.
- I thing the question is for what? It's more readable? Ohh... does it? When I'm looking for sth in the code (probably not mine, that's why I'm "looking for") when I see single quotes, I now it's just string... and moving along to the next line. It's not a big deal, though.
- For consistency? We actually have consistency now. Single quotes -> raw strings, double quotes -> interpolated strings. And this is also true among different languages e.g. PHP.
- There is a nasty lack of margin left on the ul element. UX anti-pattern (no bullets on mobile)... just saying.
— Reply to this email directly or view it on GitHub https://github.com/monterail/guidelines/issues/228#issuecomment-114617569 .
@monterail/dev any other comments?
I'm for using double quotes everywhere.
:+1: for double quotes everywhere
Double quotes in ruby sounds good but I don't care about consistency in this case.
Benchmarks show that we gain milliseconds while using single quotes which is obviously not worthwhile.
I use doubled quotes when I know that interpolation will be needed and single one in other situations, but I know that there are sometimes some optimalization fans and they prefer only singled quotes religion, and that's doesn't bother me. If they want to waste their time for going through the project and change every single one quote that's they call.
I don't think this is a big issue with single/double quotes and programmers should decide for themselves which side they are on. In my opinion, this shouldn't be normalized.
Optimization is not the issue - it's a myth in this case.
The issue is being consistent. To be honest - it is painful for my eyes when I see mixed style e.g. in Gemfile. But that's me.
I think that we should be consistent across the same files. For example as you said in Gemfile but it wouldn't bother me if I got one type in Gemfile and another in Rspecs.
@metrox - But it's beter to have general guideline about that in the project, because then you don't have to check what is used in the file you are currently in.
I was resistant at first but after observing how I work with single quoted strings for a while I agree that just always using double quotes is better. It's useful not only for interpolation, but also when using apostrophes in sentences (e.g. in specs), changing single quotes to double is irritating.
Will create pull request as I think most agree.
http://anti-pattern.com/always-use-double-quoted-strings-in-ruby
WDYT?