News for hackers. Stuff that matters.
Re:Airbnb JavaScript Style Guide by vog on Friday July 03, 2015 @02:57AM (#9823963)
For such cases I find the Python style most appropriate. It says that you use some consistent default (e.g. always single quote), but for all a strings that require escaping, you should use the delimiter with the least (preferably no) escaping.

Note that this is easier in Python than JavaScript because Python provides more string delimiters:

    'He said hello.'

    'He said "hello".'

    "Don't say hello.'

    '''Don't say "hello".'''

    r'Some regex\sstuff'
Re:Airbnb JavaScript Style Guide by icebraining on Friday July 03, 2015 @06:11AM (#9824601)
The only problem is that sometimes it leads to bugs when people mix different delimiters - like in your third example :)
Re:Airbnb JavaScript Style Guide by jaredmcateer on Friday July 03, 2015 @09:21AM (#9825401)
Note that as of ES6 there is the template string literals using backticks so it looks like JS is at parity with your example.

    'He said hello.'
    'He said "hello".'
    "Don't say hello."
    `Don't say "Hello".`
    /some regex\sstuff/
Mainstream support just isn't there yet.