News for hackers. Stuff that matters.
Re:Stop ‘Using’ “Useless” ‘“‘Quotes’”’ by chrismorgan on Tuesday July 21, 2020 @12:25PM (#23908189)
When writing my code for myself only, I don’t quote my attribute values unless necessary. If writing in a shared project, I will match the existing style, which is almost always to use quotes.

But things that bother me much more are:

• Putting type="text/javascript" on <script> and type="text/css" on <link rel=stylesheet>. These are 100% useless and I can’t think of any justification for people choosing to write them that way, whereas I can easily for quotes on attribute values.

• Trailing slashes on HTML tags. As far as the parser is concerned, these are completely useless in HTML (though not SVG or MathML). The spec basically says “oh, there’s a trailing slash on the tag? Sigh, don’t they know XHTML died? Skip it.” Worse, I think they’re actively slightly harmful because they may make people think that you can close tags that way, like in XML. You can’t. The trailing slash is only valid on void tags like <img>, where there is no closing tag, and the parser only special-cases ignoring it for convenient compatibility with XHTML/XML documents.

Re:Stop ‘Using’ “Useless” ‘“‘Quotes’”’ by astura on Tuesday July 21, 2020 @12:46PM (#23908414)
> I can’t think of any justification for people choosing to write them that way

My editor does that, not me.

Re:Stop ‘Using’ “Useless” ‘“‘Quotes’”’ by chrismorgan on Tuesday July 21, 2020 @01:25PM (#23908810)
Huh. Which editor? I might consider filing a bug report.
Re:Stop ‘Using’ “Useless” ‘“‘Quotes’”’ by timw4mail on Tuesday July 21, 2020 @01:45PM (#23909009)
Trailing slashes are valid on empty tags, such as <img> <input> <link> <base> <meta>. They are not valid on block tags.
Re:Stop ‘Using’ “Useless” ‘“‘Quotes’”’ by chrismorgan on Tuesday July 21, 2020 @01:53PM (#23909095)
… that’s exactly what I said.