This topic has bothered me for quite a while. There are really some people out there who believe that validators are something for standard lunatics; that passing the validation with flying colors is just another pointless bullet on someones nerdy checklist. That the sole reason for valid markup and styling are some kind of bragging rights.
That's not the big idea. It really isn't.
When you write other kinds of code, there usually is a compilation step involved. If something goes wrong, the compiler will tell you where it couldn't figure out what you meant. With that information at hand you can quickly take care of the issue.
Now, with CSS and (X)HTML things look differently. There won't be any kind of direct upfront feedback (unless you serve your documents as application/xhtml+xml). Things will either look as intended or they won't. If they look right is also a completely different story.
If it doesn't look as intended or if it doesn't look as intended in one browser, who's to blame?
Every browser got a huge list of open rendering bugs. It could be one of those bugs, right? It could be one of those horrible Firefox/Gecko glitches or one of those IE/Trident random screw ups. Maybe it's your code. Maybe the browser where it looks right got it actually wrong or maybe it just guessed right.
A validator can tell you if your code is to blame.
You see, if the markup and/or styling isn't valid/well-formed, the browser can only take a guess, close its eyes, cross its fingers, and hope for the best. The chances that every rendering engine out there takes the same guess(es) are virtually zero. Even more so if you also consider future rendering engines, which weren't even written yet.
So, by all means, do yourself a favor and validate your stuff whenever something goes awry. Do not stab around aimlessly in your code. Do not waste time by reading your code over and over again – a machine is a lot better at this.
Be also sure that you understand the severity level of different error messages. XML style IDs (thank you .Net) for example aren't an issue if you don't actually use them. Garbage attributes are also just ignored. However, things like mismatched tags, unclosed tags, unopened tags, omitting the encoding, and the like are all things you really need to fix ASAP. Errors like these will break the layout and the content.
CSS is more straightforward in this regard. Virtually all error messages indicate severe issues.
Another thing is accessibility (like WAI-AA conformance). Getting all these accessibility things right is very though. I'd even say it's basically completely impossible without the help of validators.
In a nutshell: A validator is a tool, which allows you to quickly identify issues or exclude possible error sources. It also helps you to write more robust future proof code and – if you like – even fully accessible markup.
Comments
i couldn't agree more. once i
i couldn't agree more. once i found out a clients server was hacked by noticing that the pages didn't validate any more.
It turned out there was some "extras" in the source which weren't supposed to be there and of course didn't validate.
Post new comment