How do you *personally* prefer to write HTML attributes?
I'm on team double-quotes, but I don't really understand why.
So I think I'm going to rewrite my HTML (yet again) to exclude them where possible.
I wish languages like HTML and PHP had a separate string delimiter which wasn't a single or double quote.
Something like:
$string = ❝He said "isn't it nice?"❞;
@Edent Not sure if this helps you, but back in, I think, 1999, I decided to use single quotes for JavaScript and double quotes for HTML, mostly to set a rule. I vaguely evangelised this for a few years, though doing it the other way around was also fine by me.
But at least I understand exactly why I'm on team double-quote.
@Edent double quotes for HTML, single quotes for CSS and JavaScript. No idea why, but it’s the convention I’ve seen most often.
@Edent Rather than rewrite anything by hand, why not use a minifier to make that and many other optimisations systematically, eg stripping optional closing tags, sorting attributes and class names, collapsing whitespace, etc...
@Edent I suspect that my preference for double quotes is from the first programming language I learned (Microsoft Level II BASIC on the TRS-80).