DEV Community

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

Collapse
 
rsp profile image
Rafał Pocztarski

I wrote that way exactly 25 years ago so I would argue that it is actually quite time tested and idiomatic. ;) Just to let you know, I always respect the style used in projects when I work in teams, so you won't find me adding any code in a different style that is used in the project. But I argue against using redundant attributes like type="application/ecmascript" or type="text/css" that is not only not needed but can be inconsistent with the actual Content-Type headers that are used anyway. And yes, I also quote attributes when I write professional code. But it puzzles me that people insist on quoting simple attributes in HTML like <div id="abc"> while I've never seen anyone insisting on quoting arguments in shell scripts as cp "file.txt" "directory" - and incidentally, there you also need to quote them (both de jure and de facto) when they contain spaces but certainly not for simple identifiers.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

This is a barel of snakes. 🤦‍♂️ I love your passion and your respectful answer so let's agree to, whatever we just did. I'm 15 years jr to you and perhaps I can't argue with time. But what is idiomatic isn't constant so what is idiomatic today? What is it tomorrow?

As for quotes, sometimes it's as simple as mostly every tool including my editor and linter is going to auto format in such a way, it might be a faff to keep changing that. I will study your post again before jumping to this thread.

Thread Thread
 
rsp profile image
Rafał Pocztarski • Edited

I didn't mean to imply that I am more senior so I must be right. In fact, one could argue that since I've done table layouts and rounded corners with gif borders even before sprite maps then my sense of taste has been destroyed forever.

Of course the idiomatic code changes, and quite quickly at that. I actually like your answer. If you saw my projects where the first thing I do is set up linters with the most strict options turned on and explicit AirBnb style guide and enforce it all in the CI pipeline, then it might turn out that we actually might have much more in common than it might seem.

What I wanted to do with this post is for people to select maybe half of those 24 things that I mentioned, maybe add some other things, get surprised by the result and dig more into the standards. Of course the standards are not everything, that's why we have style guides, but tell me - did you read this HTML and think "Of course this is perfectly valid HTML but it just doesn't follow my preferred style guide"?