Is W3C validation important? [duplicate]
Asked Answered
K

4

6

Possible Duplicate:
How important is W3C XHTML/CSS validation when finalizing work?

I read about validation from many sources and most will say always validate your web page. It is important that your page validate.

I understand the concept. But my site does not "validate", yet it works across every major browsers, does not produce errors in those browsers and looks correct in all browsers.

This is an example of an error I get

Error Line 38, Column 28: document type does not allow element "h3" here

var $jsuccessmessage = "<h3>We will be in contact soon. </h3>"; // success mess…

The element named above was found in a context where it is not allowed. This
could mean that you have incorrectly nested elements -- such as a "style"
element in the "body" section instead of inside "head" -- or two elements
that overlap (which is not allowed).

So I ask, how important is it that I correct these errors and do my best to produce fully validated code?

Note: I am using XHTML 1.0 Transitional for my doctype.

Krissie answered 1/8, 2011 at 4:36 Comment(0)
V
22

Proper markup is pretty important. Just because some invalid markup works in all of the current versions of the browsers you care about doesn't mean that it will keep working in future versions. As long as there is some competition in the browser market, the browsers tend to get closer to the standard and non-standard HTML has a higher chance of failing in interesting ways.

Sticking to the standards helps you future proof your work and it helps you build good habits.

Consider how many large organizations are still stuck using IE6 (yes, 6). Why are they stuck with it? They are stuck with it because they had a suite of critical applications built that only work on IE6 due to non-standard HTML, CSS, JavaScript, ActiveX, etc. These poor people are stuck with a pile of creaky ancient applications that can't be updated without paying for a complete rewrite. If they built to standards in the first place (with hacks and kludges to account for the ever present non-standard behavior), it would be easier to move forward a little bit at a time.

Everything you build that is non-standard anchors you in the present and leaves you stuck in the past next month. There's no good reason to wear concrete boots when surfing and even less reason for your clients to wear them.

Valet answered 1/8, 2011 at 4:43 Comment(5)
Pretty much the last sentence.Engelbert
I completely agree: "Sticking to the standards helps you future proof your work and it helps you build good habits."Lobachevsky
No longer true. HTML5 defines a parsing algorithm so all conforming browsers render invalid markup in exactly the same way.Clothe
@m_gol So now we just have to wait until all the browsers (past, present, future, embedded in other programs, ...) conform exactly the specified parsing algorithm so that we can keep writing broken HTML?Valet
@muistooshort I only described the trend. Everything depends on your website target but all current browsers (including IE10+) are HTML5-conforming, and IE9 had only minor bugs in this regards.Clothe
N
2

I was reading Steve Saunders' book on high performance website. He mentions many tips & tricks that offend W3C validator but speeds up the page and in turn delivers a better user experience. Better user experience will bring me better revenue so I, as a business owner, would love better user experience. On the other hand, incompatible, standard or best practices defiant systems demand more maintenance and attention. So I, as a developer, would love a standard compliant page. Choose your position wisely and you will find a middle path. Please do not take my comment as standard compliant pages provide lesser good user experience. There is no silver bullet as they say. I dont know them but they seemed to be right.

Nicolette answered 1/8, 2011 at 4:50 Comment(2)
Let me add to your argument: sometimes you CAN'T strictly adhere to standards and meet your client's (or your employers) requirements. The customer definitely comes first. But deviating from standards should ALWAYS be a "last resort" (IMHO). And I'd be extremely suspicious of any "tricks" that purport to "enhance the user experience". A "trick" that works on one platform could easily break something on three other platforms...Lobachevsky
@paulsm4, let me add to your arguments. Yes, there are times when you have to trade off compliant to other things. I mentioned Steve Suanders' name coz he is an authority on a subject and what he said is my experience as well. I myself hate dirty markup but have it running on a domain all done by me. But no one cares a) coz it works on most, not all, platforms b) it was delivered on time, on a weekend c) its useful if not very useful and is serving its purpose. As I said, there are no silver bullets.Nicolette
I
1

You should use W3C conventions as much as possible and these convention are going to be the most cross-browser compatible. That being said not all browsers implement W3C standards properly or completely. You will find that you have to break compliance to adjust for these quirks. It is not as bad as it used be, as the main culprit, Internet Explorer has been more accepting of standards.

Interviewee answered 1/8, 2011 at 4:41 Comment(0)
R
0

The importance of validation is a matter of personal opinion. Sites don't need to comply to W3C standards to work across browsers.

It's kind of like driving, some people don't obey the laws and get away with it. Eventually it will catch up to them. It's much the same with validation; the risk of invalid code is poor SEO performance, future browser incompatibility, etc.

Having valid code is just "the right thing" to do, and is encouraged by most developers that I know.

Ruling answered 1/8, 2011 at 4:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.