DEV Community

Discussion on: Are you 'using' "useless" "\"QUOTES\""?

Collapse
 
alainvanhout profile image
Alain Van Hout

Indeed. The argument is far too similar to the idea that basic politeness and considerateness is superfluous in human interactions, or for that matter, that wearing clothes when going to work isn't essential. Just because it's technically possible to leave it out, that doesn't mean that it's a good idea.

Collapse
 
darrylhodgins profile image
Darryl Hodgins

Well said.

I tend to value consistency, and there's no reason one can't be consistent by just doing the same thing (using quotes, in this case) every time. Same deal with semicolons in JS, and leaving out curly braces on one-line if blocks. To me, it's just sloppy.

In a similar vein, I have my opinion on the tabs vs. spaces debate (and let's not get into that here), I will lay down my sword so long as there's a .editorconfig in the project. Consistency, consistency, consistency.

Collapse
 
rsp profile image
Rafał Pocztarski

It is not only technically possible, but this is actually what is described by the standard and enforced by the validators. Notice that the W3C validator doesn't even emit warnings for that, let alone errors. Most people that I talk to actually think that quotes are required by the standard (they were in XHTML, see my post, so some people may believe that they still are). No one has actually told me that bare identifiers look naked without quotes like going to work without clothes :) good example. But what I noticed is that people who insist on using quotes at the same time use HTML rarely change & to & in URLs and are much less strict in other aspects. The thing with quotes is very similar like in shell scripts and I never see dd if="file1" of="file2" (in shell scripts that quotes are also needed for values with spaces but are not needed for simple single-word identifiers - just like in HTML).

Thread Thread
 
pavelloz profile image
Paweł Kowalski

Which validator exactly enforces it?

valid

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

Can't argue with that, but I can't change because it takes a movement to change the hearts of devopers and you would need an authoity such as a website org dedicated to correcting learned knowledge, such an org should permiate through companies, browser vendors and tooling, creating a linter preset and so on. This article won't be enough. But I'm glad you wrote it.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Wfh I don't NEED clothes technically 😅 pajamas work.