views:

252

answers:

10

I recently found out that most of the major websites fail W3C's markup and CSS validation tests. Therefore, how important is it really to follow web standards?

A: 

In short -- very. For purposes of cross-platform & cross-browser compatibility, it is important.

Do you need to follow them to the T? If you don't, you'll probably be okay.

A lot of things that do not follow strict standards are legacy applications that have been modified over time.

In my opinion -- there's no reason to not follow strict standards on a new project.

Ian

Ian P
+1  A: 

Browsers and other web-based readers rely on developers to follow standards and for the most part it's not hard to adhere to them. So just do the best you can but don't make yourself unproductive to follow them.

Chad Moran
+7  A: 

It depends upon the size of your audience. If it's for your blog, you can be pretty sloppy. I've done government websites, however, where it was critically important that we follow web standards and follow accessibility guidelines.

But yeah, just do it. Why wouldn't you?

Travis
+1 for the "Why wouldn't you?"
Arve Systad
Ask Jeff Atwood. I currently get 76 errors and 4 warnings on this page :-p
Steve Jessop
A: 

If you follow the standards, any layout errors will be much easier to debug. When you ignore the standards, the browser can render your page however it feels like, and changing one character can completely change how your page is rendered. Debugging one browser is hard, but debugging IE 7, IE 6, Firefox, Opera, Safari... and ignoring the standards is just going to make your life difficult.

If you are using jQuery or other DOM manipulation libraries, you can get unexpected and inconsistent results if your markup is not valid.

So, don't waste your time. Make sure you write valid HTML and CSS. It's really really easy, and will save you time.

jrockway
+1  A: 

Very important. Accessibility, usability, portability, it's the law (in some instances), scalability, easier to integrate with various application frameworks and CMSes. The list goes on but other posters have covered the points well enough.

Your average business owner typically says "who cares" much like the OP. My most effective response thus far has been "the Google bot is nothing more than a blind end user. Don't you want it to list your site effectively?"

Mark Hurd
A: 

The first thing I do is to test in my target environments. If it's working and fails to validate, it's probably a smaller point but naturally worth exploring. Course you do want to strive for accessibility as much as possible.

fig
A: 

As a side note - it's not a great effort to follow web standards. When you get used to it, you quickly notice how much of an effort it is not to do so. Using web stadnards usually produces LESS code (= less time to write), MORE READABLE code and "future-proof" code compared to whatever oldschool layout-technique you want to use instead.

Arve Systad
A: 

The only reasons website designers historically have not followed web standards are (1) not being aware of the standards at all, or (2) to make non-standard-compliant browsers (*cough IE cough) do cool stuff. But Internet Explorer has recently been making a significant move towards standards compatibility, so reason (2) is becoming less and less relevant, and you're obviously not subject to reason (1), so why not write standard-compliant websites? As others have said, it will make your code much easier to debug because you only have to work with one standard rather than a bunch of different browsers.

David Zaslavsky
A: 

The thing about these big sites is that they have an army of programmers to guarantee that the site keeps working.

Do you? Are you willing to spend your money on that?

The problem with not following the standards is that you have no guarantees of how your site is going to work in tomorrows browsers.

Then there are other issues, like accessibility, or enabling automated tools to parse your site. Whether this is search engine web crawlers or sites aggregating information available from microformats, or screen readers for blind people or any of the dozens of other tools that need to be able to read your site, you've no guarantees they'll be able to parse your site if it's a random tag soup.

Then there are the tools that you yourself us. Will jQuery or other javascript libraries be able to figure out your weird non-standard DOM? Maybe, maybe not. Will next week's version? Who knows?

And finally, what is the cost? It's not that hard to write compliant HTML/CSS. It takes some practice to figure out some of the CSS tricks to avoid relying on deprecated or nonstandard HTML, but once you've figured it out, it's just as easy to write as your typical sloppy nonstandard code. And of course it may even make things easier, because it allows you to meaningfully use tools like the HTML validator when debugging. It's hard to use that for anything useful if your site contains 50 HTML errors in any case. Which one of them, if any, is related to the problem you're trying to fix?

jalf
A: 

If everything works in all the browsers you want to support, it's not really that important that HTML code actually validates. For XHTML, it is important, though: using XHTML implies that you want your code to be readable by XML parsers, so anything which isn't valid XHTML shouldn't be declared as such.

But creating standards-compliant code isn't hard, ie anyone who doesn't bother to fix errors shows a lack of professionalism. Sometimes one might decide to ignore the standards, but that should always be a concious decision - eg the Google home page is optimized for speed and cross-browser support and has been tested extensively. If you don't have the resources for such testing and continous support, you should stick with the standards.

Christoph