Why do major websites not pass W3C validation properly? [closed]
Asked Answered
W

3

15

In an attempt to understand if W3C validation can assist better DOM rendering or if it is just a standard for HTML coding, I tried to validate major websites but all of them fail with some errors.

Here are typical examples:

  • google.com 36 Errors, 2 warning(s)

  • facebook.com 42 Errors

  • youtube.com 91 Errors, 3 warning(s)

  • yahoo.com 212 Errors, 8 warning(s)

  • amazon.com 510 Errors, 138 warning(s)

When major websites do not seem to spend enough time for W3C validation, is it needed to spend time to do so for small- and medium-sized websites?

Waist answered 26/3, 2012 at 10:49 Comment(9)
I think this question actually contains two subjects (both of them interesting): 1) Do I need to generate valid HTML? 2) Why don't they do it?Shere
possible duplicate of #8440Ashford
@TomWijsman That question does not pay attention to failure of major websites. Rationally, it is good to pass any validation; but the point is why major websites do not do this if it is substantially important!Waist
@Ali: For the same reason browsers to not fit all Acid3 tests. Note how all of google.com's error are obsolete for instance, which just means they haven't yet progressed onto higher standards which is most likely because of backwards compatibility. Also note how the error count is actually pretty low and actually scales with the amount of components on the page, so they really do try to comform to the standard and they do validate their site to decrease the amount of errors where it makes sense...Ashford
The reason why pages such as google.com do not validate properly is that they probably just care about two things: proper display in all major browsers and minimal sizeErl
@Erl They why we should not care for these two things ONLY?Waist
possible duplicate of Is W3C Validation Important?Slumberland
HTML5 defines a parsing algorithms so all conforming browsers pass invalid markup in the same way. That is one reason why validation doesn't matter a lot anymore.Duce
Another reason is that today's websites are so dynamic that even if you validate your index file, you won't be able to check if e.g. all your scripts use valid HTML in their innerHTML substitutions etc. So you can validate only partially. Together with my first comment it gives a clear picture why valudation isn't so important anymore.Duce
V
11

Validation is a sore issue. In XHTML days (pre html5 doctype ubiquity) it was almost impossible to validate a complex layout against the strict DTD published by the W3C. I think you could probably point fingers at IE for being the prime culprit, as so many totally non-standard hacks were needed to make it behave in a reasonable cross-browser way, and IE was and is the most-used browser on the planet. It is to be lamented that MS, instead of following the lead given by webkit and gecko engines, have decided to add yet more browser extensions and hacks to muddy the waters, instead of going for plain adherence to the 'standards'.

We all know that if time were not an issue, we as developers could create pages that validate, but in practical terms, as the others have pointed out, validation ends up being a helpful tool not a defacto objective. If a client demands validation, then there is a cost involved, and that has to be explained - managing the expectations here is very important.

The html web advanced in very short time from being a very simplistic semantic text layout engine to fully dynamic applications running inside the browser, and the validation tools simply have not kept up with this. I'm not even sure they can, given that browser technology is advancing daily, across a thousand or more different platforms.

So - rounding up, it's a tool to be used by developers, but your own personal ability is what will determine if the project is fit to purpose or not. Having an icon or green 'ok' box in a validator is absolutely not going to define if a project fits this definition or not.

Victimize answered 26/3, 2012 at 11:11 Comment(1)
+1 for pointing out the complexity of modern XHTML documents.Waist
L
3

Validation is cheap quality assurance. It will help you spot errors (especially nesting errors and those those caused by mistyping something). It will save more time then it costs (especially if implemented at the outset).

I've not seen any performance metrics for error recovery routines in browsers. It would be hard to produce any which would give useful information as there are so many different errors.

Lemmie answered 26/3, 2012 at 10:57 Comment(0)
S
2

In my opinion the best reason why you should validate your pages, is that then you have the highest probability that your page looks the same in every browser. And you minimize the probability that the layout (or even some Javascript logic) is broken.

Schematism answered 26/3, 2012 at 10:57 Comment(3)
W3C validate needs many standards which are not helpful in real world. For example, you cannot start id with numbers.Waist
@Ali - hardly a big issue. What real world example demand you start with a number and you cannot possibly prefix with a character?Hinge
@Hinge That's the point. Is it useful for spending time to se prefix. Note that this was an example. I think major websites do not spend this time.Waist

© 2022 - 2024 — McMap. All rights reserved.