Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

With us moving continually closer to HTML5 in terms of adoption, is writing HTML for validity something the web is rejecting, allowing us to straddle standards as the web continues to be in a perpetual state of transition to the "next" thing?

Is validation important?

  • If so, what is the net gain?
  • If not, why not?
share|improve this question

marked as duplicate by gnat, Kilian Foth, MichaelT, Dynamic, Dan Pichelman Aug 7 '13 at 15:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

4 Answers

For once, Google penalizes websites with HTML errors, not sure how much.

They do the same with slowly loading pages, and HTML rendering is a CPU extensive task and doing something incorrectly forces the browser to "guess" the correction, this slows down the page rendering time and even worse browsers often guess wrong.

As a page gets complicated by other dynamically inserted elements with invalid HTML, chances that whatever was detected/ignored by the browser will now becomes in effect, and that cost more to fix than initially considering validating HTML.

share|improve this answer
add comment

HTML 4.01 Strict Validation is one of my automated tests in my ATDD test suite.

For us validation is important because of consistency of browser behavior. So if you don't need consistency of behavior across different browsers (and browser versions), then it's probably more of a nice-to-have.

Driving consistency of behavior for all your pages makes the following cheaper:

  • more uniform behavior
  • more uniform placement
  • page "tweaking"
  • easier ADA compliance (remember Target, Walmart, and other have been sued over this)
share|improve this answer
4  
Since when has W3C validation guaranteed cross browser consistency? I just think the gain of using newer tech that's (mostly) adopted has a much higher upside then breaking validation has in downside. –  jondavidjohn Feb 9 '12 at 18:57
2  
@jondavidjohn: It hasn't guaranteed cross browser consistency, but it's been as close as we can get since no such guarantee exists. You can refer to this: hsivonen.iki.fi/doctype on how doctype choice determines rendering, and how quirks mode for "tag-soup" is harder to get consistent behavior for page to page. –  dietbuddha Feb 9 '12 at 19:54
add comment

HTML validation isn't a huge deal deal for a few reasons, that don't really have anything to do with HTML 5.

  1. It doesn't really mean anything other than some group says this is right, if you did everything else right a validator can't check.
  2. HTML isn't source code for a vast majority of projects, other things are generating HTML and you have limited power over influencing how that is done.
  3. The only thing that has ever really mattered is it works in popular browsers and validation has traditionally been a mediocre guarantee of that.
share|improve this answer
2  
+1 for the third point. –  FrustratedWithFormsDesigner Feb 9 '12 at 20:15
    
3. Except when you get sued for ADA non-compliance. –  dietbuddha Feb 16 '13 at 5:07
add comment

Validation will always be important, but during times of transition from one standard to another it's very difficult to pull off. It's especially hard when the standard isn't even finalized and agreed upon yet. So while validation is important, business is more important and simply won't wait for validation. So there will inevitably be some indefinite transitional period where validation will be summarily discarded in many cases until a more stable standard is reached and implemented that can provide a reliable basis for validation.

Html5 is "out", but it isn't set to be finalized until 2014 sometime.

share|improve this answer
1  
So it's less important than the business, but does the business have anything to gain by having their markup be validated? I guess my thought is that it can't be important and at the same time just be a "nice to have". –  jondavidjohn Feb 9 '12 at 18:17
    
@jondavidjohn: Yes, there's a gain but it's seen only on the bottom line when it comes to maintenance. If a page validates, it is less likely to require massive maintenance across the browser platforms. However, that gain is minor in comparison to potential work stoppage. I would say it's more than a "nice to have", but I can guarantee you no one outside of IT is really losing any sleep over it. –  Joel Etherton Feb 9 '12 at 18:24
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.