News for hackers. Stuff that matters.
Re:HTML Validation: Does It Matter? by jrockway on Friday March 06, 2009 @11:23AM (#505596)
Validation probably doesn't matter to your users anymore. (If everyone wrote valid markup back in the day, browsers would be faster, more secure, and more stable. But that ship is sailed, so you're stuck with broken browsers for backwards compatibility reasons.)

With that in mind, though, it's easy to write valid markup. All the rest of the code in your app has to validate, why negelct the HTML? Making sure that your markup is valid will save you time when you have to debug a weird rendering issue (or JavaScript's view of the DOM).

Finally, if you even have the opportunity to pass invalid markup from your app to the browser, you are probably doing something wrong. In my apps, I load the web designer's templates (which may be invalid HTML) with libxml2 (it has an HTML loader), process them programatically, and then serialize the DOM for the browser. This way, the browser always gets something valid -- my program's type system enforces this.

Valid HTML means you have one less thing to worry about.

There are no comments on this comment yet.