Step Away from the Validator January 7th, 2009
I spend quite a bit of time keeping up with the happenings of the software industry. Part of that is reading blogs, reddit comment threads and the like. One of the topics that seems to come up regularly is a (sometimes heated) discussion about validation.
There's a guy who can't get his code to validate or notices that
'insert popular website' doesn't validate and flips out and
writes a comment or something on his own blog about how we're
filling up the tubes with apocalyptic, non-standards compliant, code.
I'd like to add my 2 cents to this topic.
In the Eyes of the Validator
This page (and, as far as I know, all the pages on this site) validates as XHTML 1.0 Strict, but it doesn't matter. If I hadn't mentioned it, would you notice? Would you care? If the site works for you then what difference does it make?
Is there a point of validating at all? Indeed, the fact that your site validates proves exactly nothing about the quality of your pages. What it does do is a couple of important things:
- Keeps your code maintainable.
- Helps spiders/robots index your content.
- Other programs (such as screen readers) will have an easier time, too.
- You're less likely to get bitten by new browser bugs (browsers are, assumingly, moving towards improving their rendering of standards compliant code).
- Bragging rights...?
Mangling the DOM
So your site is perfect in every way. You've got your blog articles and they've
img tags and
blockquote tags all nested in the
'correct' way. Nothing strange going on at all, you've even tracked down all
of those pesky missing
alt attributes. Everything passes the
validator with flying colors.
But then you decide that those links that go outside your site really shouldn't
that looks for links with
rel='external' and sets their
target attribute to
... we arrive at ...
Ok. So what? Of course there are other ways to get a link to open in a new tab, and there are often other ways around similar problems to this. Maybe you'd suggesting switching to Transitional instead... That's my whole argument! Switch to a different validator, perhaps Transitional, perhaps "does it work for my users?" What you shouldn't do is spend two weeks forcing the page to pass some artificial test that has no impact on you or the people using the site.
So you take my advice and fail validation based on some DOM manipulation that helps your users, that's great! It means you have your priorities straight. Case closed, move on with your life.
rm -rf validators/
Of course, I'm not saying to get rid of the validators entirely. They're clearly a useful tool to, at the very least, sanity check your code. Under what circumstances am I suggesting to give up on validation?
- Internet Explorer is doing it's best to drive you to suicide and the only way you can find to fix the bug is to break validation. Just go for it.
- The code is quite old, and there is a massive amount of it. If it ain't broke, for your own sanity's sake don't touch it more than you absolutely have to!
- There's no real 'business reason' to care. If in doubt, complete this sentence: "This page needs to validate because..."
- What will it actually cost you to skip it?
- What will it cost you if you don't skip it?
Save Time, Effort and Sanity
You'll live longer with validation as a tool instead of as a goal.
Some social stuff: