DEV Community

Discussion on: Stop 'using' "useless" "\"QUOTES\""!

Collapse
mattschwartz profile image
Matthew Schwartz

I have to disagree with this one. One reason browsers are so large and complicated is because they have to compensate for content which breaks standards and features which are optional. Otherwise a huge chunk of the internet would go dark.

You can't completely do away with quotes because sometimes they're required. Multiple class values are separated by spaces. Must be quoted. Meta tags such as description contain spaces and must be quoted. Having values sometimes quoted and sometimes not is not a friendly format for readers or parsers.

Collapse
rsp profile image
Rafał Pocztarski Author

I would never argue for any code that breaks standards. In fact, back in 1996 all my pages had Valid HTML 3.0 badges (not only that, but also a "Best viewed in any browser" banner - which was quite unusual at that time, most of the pages were "best viewed" either in IE or Netscape, but I coded strictly to the standards and not for the browsers. So when XHTML came out in 2000 I changed all my id=menu to id="menu" as required by the standard (even though it was not required by the browsers!) and then when HTML5 came out in 2007 I changed it back, because they made it no longer required again.

I argue that the only reason that web developers quote everything is that in one point it became required because I remember web development from before 2000 and no one did it. In fact almost no one did it even in 2000 because not many people have adopted the latest W3C recommendation as quickly and followed the rules as strictly as me.

Now I often hear the argument for consistency, but why I never hear that in shell scripting sometime we have to quote arguments so why not quote all of them for consistency? That argument for consistency seems quite inconsistent with other languages with almost exactly the same rules for quoting arguments.

In any case, I wrote this post to show people what is actually required and what is not, some of those things in my opinion actually should be required (like the head and body tags) and it's always good to know what is really in the standard and what is just a convention.