Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: incrediBILL
Some say that search engines like valid code, but if thats the case, then why dont google themselves validate their home page?
Some say that search engines like valid code,
Jury's out on that one - but I think, in terms of search engines, a definite benefit is it forces you to clean up your code. Cleaning up your code and using semantic HTML exposes your content more efficiently. And that can't be bad for search engines in any case.
As mentioned, cross-browser rendering is #1 of my reasons for validating.
1. Valid documents, which inherently require using a valid doctype, cause browsers to render your pages in in Standards mode. See #2.
2. For the longest time, I couldn't figure out why some of my CSS didn't work, or worked in one browser and not the other. Then I realized it was because a) I was using a "half" document type and b) my code didn't validate. A document in quirks mode will cause some CSS methods to fail. Validating your pages helps assure that CSS is functioning as you expect.
3. Validating your code forces you do do all of it right, or if not right, at least to standards. For example, in Standards mode, ffffff is not a color - it needs the pound sign, #ffffff. Another common instance is most people don't use the alt tag because they don't understand it's purpose, or are just annoyed by the IE yellow "pop up" that appears over images. Missing alt tags will choke the validator every time - and it explains why you need them. So validation is an education-in-process that keeps you centered, it forces you to dot those "i's", cross those "T's" . . .
4. Validating helps you eliminate deprecated elements, such as <font> and <center>. This also applies to forcing you to clean up your code; when you rip out all the font tags and other deprecated tags, what is left? Your content!
5. Validating makes it easier to understand the relevance of using the correct doctype [webmasterworld.com] and so much easier to move to other doctypes if required. A valid 4.01 strict document is a few short steps away from an XML doctype.
6. It gives you a first plan of attack whenever things go wrong. Watching this recent thread [webmasterworld.com], I will guess that this will lead the poster to a positive solution in very short order. This is almost always the first stop if things are going wrong.
7. Valid documents are a prerequisite to accessible documents - although that is another issue entirely, the document must first validate before you can address accessibility.
8. It gives other designers who would steal your clients one less thing to pick at, and one more thing to support quality control in your work.
9. When you wonder, "Am I doing this right, is there a better way?" a validator does just that - helps you validate your coding decisions.