Validation matters

When I write HTML code I want to check if I made any mistakes. Same thing if I use an application or a CMS that outputs HTML code. So I use validation as a tool to check the HTML code for errors. If there are any I want to find them and fix them if I can.

Even though I think it is a very important part of developing websites, validation in itself is not the goal. Validation is a tool to help you produce well-formed markup that is universally parsable and hopefully understandable and maintainable by other developers.

When you strive to keep all validation errors out of your HTML, the validation tool becomes much quicker and easier to use—if it flags an error you immediately know that it is something you need to fix. You don’t have to manually check if it is on your own list of “allowed errors” or if it is a real error like a typo, a misnested tag, a forgotten end tag or a forgotten alt attribute.

Web browsers are forced by the zillions of web pages that are filled with junk HTML to be very forgiving when it comes to invalid HTML, so many kinds of validation errors do not affect the end result at all. But in almost all cases neither does correcting those errors, so there is no point in not doing so.

I can think of two valid (haha) use cases for invalid markup:

Writing invalid HTML just because you can is not one.

Posted on September 27, 2010 in Web Standards, (X)HTML