

Consistent use of double or single quotes in HTML - persand
https://labs.kollegorna.se/blog/2015/01/double-single-quotes-html/

======
whafro
It's nice to see pedantry validated, occasionally.

Still, this will invariably lead to a few arguments behind closed doors:

\- "We should obviously standardize on single quotes, since they're shorter
than double quotes and save more space!"

\- "Our site serves up dozens of pageviews a day – let's spend the next week
scrubbing our markup for consistency!"

\- "If you're using mixed quotes in your markup, you're Doing It Wrong!"

------
collyw
So basically it comes down to insignificant performance and size boost. The
reason for being able to mix them is so you don't need to escape quotes by
using the alternative type.

I think consistency makes code look nicer and perhaps a bit more readable, but
lets not kid ourselves that this leads to any meaningful improvements.

------
smhenderson
Most of my HTML is generated by Perl so I am the opposite. Alls string vars at
the Perl level are wrapped in double quotes in case interpolation is
necessary. Attributes are wrapped in single quotes so my Perl code doesn't
contain a bunch of \" patterns scattered throughout.

I totally agree about consistency though; I even take the minor performance
hit when interpolation is unnecessary by using double quotes anyway so that
all uses of double and single quotes are consistent

------
Malic
I would view it as a "code smell" \- if you aren't concerned about mixed
single/double quote usage, then what ELSE aren't you concerned about?

~~~
persand
[http://media0.giphy.com/media/WKhKazqZxORq0/200.gif](http://media0.giphy.com/media/WKhKazqZxORq0/200.gif)

------
_mtr
The first thing that came to mind when reading the title of this post was
Google Fonts. Maybe this is validation that I need to write that Chrome
extension that comes to mind every time I'm copying that snippet.

~~~
persand
We've reached out to the Google Fonts team…
[https://twitter.com/kollegorna/status/559728201514373120](https://twitter.com/kollegorna/status/559728201514373120)

