Validation Is Still Relevant

I was listening to a Sitepoint podcast when they started talking about whether they still validate their HTML or not. This being my expertise, I quickly perked up my ears to listen to what the “experts” were saying. And I was disappointed.

Perhaps the guys who take care of the podcast aren’t coders, or aren’t front-end developers, and if that’s the case, then I forgive them for their validation transgressions. I just hope they really aren’t front-end developers…

What They Said

The guys at Sitepoint admitted they no longer validate their sites, and none of their sites could pass basic validation. They believed that because large sites like Google and Facebook didn’t validate, why should they? They then commented that validation is no longer important today.

Validation Is Important

I’ve always believed that validation is important, especially since I decided to focus my career on front-end development. Surprisingly, this is a source of a lot of debate in the development world, which makes about as much sense to me as policemen disregarding their standard rules.

Validation is written by the W3C, which takes care of HTML and CSS standards. Validation rules are like guidelines, you don’t have to do it, but it’s something you should do.

Passing validation helps in several ways – it helps you rule out browser bugs, your code tends to be cleaner in nature, and you help push a browser standard that will make it easier to code for in the future. Think about it – if developers didn’t care about following standards, why would browsers? We’d probably end up back in the Netscape/Internet Explorer days where each browser went off in their own direction in how they rendered items. It would be like hacking and coding for each browser – and we’re trying to move away from hacks right? (Which is why I’m holding off on using HTML5).

Plus it holds your code to a higher standard and shows you care about quality. Designers don’t have to use grids or good typography to make a living, both those that do are often more successful. The same with developers. I’ve actually had clients go through each of my portfolio pieces to see if they validated.

Validation Is More Important Than Ever

Not only has validation always been important, but it’s now more important than ever. Even though it can’t directly affect your SEO, getting rid of extra divs (divitis & semantics related to validation) allows the Google bot to make it through your code easier and ensures they capture all of your content.

With the proliferation of new kinds of browsers as well (think mobile, iPads & netbooks), validation becomes even more important. I just finished coding a huge mobile site for Audible and encountered several bugs invisible to Firefox and even the desktop version of Safari. Upon glancing at the iPhone, however, you could see huge layout issues. The problem was mismatched tags and improper nesting. Had I not gone and validated the site, I could’ve been searching for the bug for forever.

Resistence

I’ve never understood why a lot of developers never took the extra step to validate their HTML. A lot of the complaints I get about validating, is that it takes forever. However, it should easily take you less than five minutes to validate your code if you learn proper syntax and rules. It’s easy.

Of course, there are always exceptions to the rule. When a client insists on a new browser window popup on link, and for some reason you’re unable to use JS for this, you’ll often find yourself using target=_blank and that’s ok every once in awhile, although you should try to deter the client from new browser windows due to user annoyance.

I will admit that I don’t bother validating my CSS. Before CSS3 I never really had any CSS validation errors, and if I did it was easy to tell by the messed up website. Now that I use a lot of CSS3 and vendor prefixes, I don’t even bother to look. But these aren’t improper syntaxes or hacks – they’re still valid code.

Your Thoughts

Do you validate your code? Why or why not?