August 26, 2008
Validation
When you start getting into web standards, validation is the holy grail. Beginning web designers of this world decorate their brand new portfolio websites with cute XHTML/CSS valid buttons. We’ve all been guilty of this. At some point, these web designers are proud to call themselves a standarista, and boo at anything that resembles a table-based layout or so-called non-semantic markup. Instead of looking at how it works, they rinse a website’s code through the validator to nag about alt tags attributes and your “horrendous” doctype choice. “Everyone” knows XHTML 1.0 Strict is the way to go.
As you mature in coding, writing markup and stylesheets, and working on actual projects, things change. There’s money on the table, there’s a deadline, and there’s 80 fucking hours to make the website you’re making the next best thing since the internet. And then it’s time to realize that the only thing validation really is, is a little tool to help you out.
It’s an automated check to fix mistakes made along the way: badly nested divs, typo’s in your CSS, that proprietary IE rule you forgot to put in your conditional comments. It doesn’t matter if not all your alt tags are filled in and it doesn’t matter that the embedded YouTube video fails validation. Covering that up with swfobject isn’t going to do much. Look, those 0.3% of people you’re spending 20% of your time on: let it go. There’s a bunch more important stuff to do within your deadline than making sure every tiny validation error gets fixed. Every moron 3 months into webdesign can write valid XHTML/CSS, but how many people can create websites that are truly usable?
Well, that’s all cool, but you have 3 validation errors on this page .
…
Just kidding of course. It’s as you say, validation is a tool and not a goal in itself. A tiny green checkmark at the right of my status bar is a comforting sight though. :)
What I hate however is those situations when you have to include or rely on external code that is blatantly invalid. There are still loads of people to educate…
August 26th, 2008 at 4:22 ∞There’s no such thing as an alt tag, it’s an alt attribute. How’s that for nagging ;-)
August 26th, 2008 at 4:38 ∞Thanks for the correction.
August 26th, 2008 at 4:55 ∞Validation is much like checking for spelling. It helps you get rid of basic mistakes but doesn’t say a thing about grammar. A text without spelling errors can be an awful read. Semantics are way more important than validation.
Much the same thing goes for design and for that matter usability. Non-designers try to come up with standards and sets of rules, magic formulas to get perfection in usability, therefore limiting layout solutions (links in blue, visited in purple?). It takes common sense, lot’s of trying and testing and a feel for design to come up with a decent user experience. Not a magic formula.
August 26th, 2008 at 5:16 ∞“It doesn’t matter if not all your alt tags are filled in”
Indeed, it doesn’t matter, because an empty alt attribute is perfectly valid. Not including an alt-attribute on an image does give you an error and it does so with a reason. So including it DOES matter. If you don’t know what to fill in, it probably means it’s perfectly all right to leave it empty.
“Look, those 0.3% of people you’re spending 20% of your time on: let it go.”
Problem is that one of the visitors belonging to those 0.3% might be your Google spider. See if you care then! ;-)
You’re right that a validation error is not the end of the world. Sometimes it’s there because you consider the alternative worse. If it’s there out of laziness, you have a problem. (You won’t fail a deadline because of the time spent adding alt attributes, you know.)
August 29th, 2008 at 3:19 ∞@Pjtr
And just what might that reason be? Semantics? Accessibility issues? You have to admit that it is at least a little awkward that an empty alt attribute validates, and an omitted alt attribute does not. The end result is precisely the same.
Well, even from a SEO-point of view, there is no reason to be focusing on details like proper use of alt tags (where it isn’t necessary) or valid (x)html markup. Google doesn’t try to validate your code or anything, it merely interpretes it. “Valid” code or not. I think the main critique here was pointed at people who implement JavaScripts to implement their Flash just so their page would validate–I’m not talking about the former IE issues here. Hell, YouTube (Google) even outputs invalid code for embedding Flash video’s. How’s that for not caring :).
I totally agree with Wolf here, by the way. In fact, I’ve been meaning to write the exact same article for a long time now :). Time is never on your side when you need it ;-).
August 29th, 2008 at 5:59 ∞Hi Xavez,
There’s a big difference between an empty alt attribute (saying “this image does not require a textual alternative”) and not using an alt attribute at all (saying… nothing at all).
I think it’s an accessibility issue first. Screenreaders - as you will know - will read the alt attribute. If the attribute is empty, it will know it can jusst skip that image as there’s nothing to read. If the alt attribute is missing some screenreaders will opt for the second best (but not good at all) option: reading out the images file name.
Secondly it’s also a findability issue, but I’m sure you and Wolf will not forget to put alt attributes on images that really require them.
About Google and valid html markup. It’s true that Google doesn’t care about validation. But it does care about well formed xhtml. It has been known to stop indexing pages with bad xhtml because some people use it as a technique to feed content to Google that they hide from visitors.
Don’t get me wrong: I agree with Wolf on most of the things he’s saying. But I think he used the wrong example (the alt attribute) and people like Wolf dismissing validation as just ‘a little tool’ will send a wrong message to people who are not as educated on the matter as he is.
Oh, and as far as ‘real projects’ and ‘money on the table’ goes: more and more of our clients require markup that validates. Not to speak of our own developers that need to integrate my markup.
August 30th, 2008 at 12:07 ∞Hmm, I think we’re not really talking about the same thing here. What I was actually trying to say, is that as far as the standard goes, there is no real logic behind validating an empty alt attribute and not validating an omitted alt attribute. I’m talking theory here, and not practice–you’re definitely right on the Google issue. It is my opinion that the w3C should have made a choice: either an empty alt attribute is invalid, or omitting the alt attribute is valid. With this specification, they have created a situation that is really open for interpretation. Tell me: what’s the real difference between omitting the alt attribute, and not filling it out? As far as semantics go (and semantics are the reasoning behind alt attributes) there simply is none. Quite an ambiguous situation, if you ask me.
You might be right concerning certain people reading this blog and not thoroughly reading through the article. Then again: you cannot blame Wolf for people not reading and correctly interpreting what he’s saying. I, for one, thought the article was crystal-clear. Then again, I might be “prejudiced” by my background–since I already felt exactly the same about the W3C validator and people using it as an excuse to say they write awesome code. I’m guessing Sweet Charlie whas right when he said Validation is much like checking for spelling.
August 30th, 2008 at 1:52 ∞Jeff Croft cites his biggest web development pet peeve:
August 30th, 2008 at 11:12 ∞@Xavez
I agree that it’s perfectly possible (and pretty easy) to write horrible code that validates. It’s also perfectly possible to drive dangerously while still honoring the speed limits. That doesn’t mean speed limits are not important.
Tell me: what’s the real difference between omitting the alt attribute, and not filling it out? As far as semantics go (and semantics are the reasoning behind alt attributes) there simply is none.
When your friends ask you if you want another drink, do you say ‘no thanks’ or do you just keep silent? (You’ll probably say you want another beer, but just lets *pretend* you’ve had enough ;-) Although I’ll agree with you that there are standards that make no sense at all (padding adding to the width, who ever came up with that!?), I think it makes perfect sense to specify the fact that there is no alt attribute required.
Looking at the state of the web today, I think it’s also hard to imagine that all images lacking alt attributes don’t actually need them.
@Wolf
Although I agree with Jeff Croft, it’s strange how people think that you can’t have both.
Bad semantics or bad accessibility are usually a result of laziness or ignorance, not because it prevents you from building the best user experience ever.
I’m far from perfect myself (sometimes I’m even lazy *and* stupid at the same time, how bad is that?), but I strive to get better and make every new site better than the one before.
It’s pretty strange that we’re arguing about all this, since we probably agree for like 95%. It shows how strong we feel about these issues, and that in the end is what really matters.
August 31st, 2008 at 9:55 ∞@Pjtr
August 31st, 2008 at 10:00 ∞You’re probably right that we mostly agree, I just needed a post to refer to if someone would get all standardista on my ass ;).
[...] Als er één manier is om het web vooruit te helpen is het om te stoppen met klachten over validatie en het experiment aan te [...]
January 19th, 2009 at 1:12 ∞“typo’s”
Ironic.
March 27th, 2009 at 8:57 ∞[...] HTML puristen zullen nu claimen dat het niet moeilijk is om een pagina te laten valideren (waar); de zin van het valideren, buiten fouten tegen de HTML syntax om, ontsnapt me volledig (zie ook wat ik hier eerder over schreef). [...]
August 12th, 2009 at 11:11 ∞