David Hayden [MVP C#]

Sponsors

The Lounge

Wicked Cool Jobs

News

  • CodeBetter.Com Home

Other Links

Teas

Patterns & Practices

Florida .NET Developer

Book Reviews

Tampa ASP.NET MVC Developer Group

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Business Value of XHTML and Valid Markup?

I spent the better part of a day changing the UI of a client's website to:

  • Maximize Search Engine Optimization
  • Ensure Valid XHTML Markup

Although I fully understand the value of proper search engine optimization and can actually measure its effectiveness, I wonder about the current value of using XHTML instead of HTML and making sure the XHTML or HTML is valid.

Valid Markup

Is there any business value for having valid markup ( whether HTML or XHTML ) assuming the current and perhaps invalid markup doesn't screw up the look of the page on the major browsers? Does having invalid markup hurt your position in the search engines or cause your website to be less visible or not enjoy certain web services? I, personally, don't know, and know of a number of very visible and popular websites that get wonderful search engine positioning and have invalid markup.

Take CodeBetter.com for example. If you check our main page with the W3C Markup Validation Service, at this time it complains of 41 markup violations using XHTML 1.0 Transitional:

 

http://validator.w3.org/check?uri=http%3A%2F%2Fcodebetter.com

 

The violations don't appear to have hurt our ranking in the search engines and the homepage looks fine in IE and FireFox, so my opinion would be to let it go. And, let's face it, a lot of the content is added by us bloggers and I doubt many of us are ensuring our content is XHTML 1.0 Transitional compliant. I don't know for a fact, but my guess is that Community Server also doesn't validate any markup either.

Although I agree that valid markup is a positive and a worthwhile goal, I wonder if one can measure it in terms of business value and justify making sure the pages are valid and stay valid.

XHTML vs. HTML

I also wonder about the business value of choosing XHTML over HTML. By default, I believe ASP.NET uses XHTML 1.0 Transitional. If one is starting a website from scratch, one might as well use XHTML because it appears to be the direction markup is moving, but I don't have my pulse on this standard enough to tell you any current tangible business benefits for choosing XHTML over HTML, and I certainly can't think of any justification to move a site from HTML to XHTML for that reason alone.

My guess is that we are in a transitional phase right now and most of the benefits of XHTML over HTML won't happen until more websites adopt the standard and certain services pop-up that consume XHTML to help in some way.

 

Drawbacks of Standards and Valid Markup

I just thought of this while typing, but one of the drawback of standards and valid markup is that your site's content is more accessible. Accessibility is kind of a double edge sword. It has the drawback of people taking your content and using it for reasons you do not intend. I am not suggesting that not adhering to standards and having invalid markup is a good thing, but cetainly it makes your content less accessible to automated content scavenging by people with questionable morals.

 

Conclusion

I have really just been thinking out loud here, but would love to hear from people who are far more skilled in these areas and understand the business benefits of valid markup and XHTML. I am not suggesting these are not worthwhile goals. I just can't think of any worthwhile business benefits for consuming a lot of time and energy on such pursuits. Would love to hear of some if they exist.


Posted Sun, Apr 9 2006 12:51 PM by David Hayden

[Advertisement]

Comments

Joshua Flanagan wrote re: Business Value of XHTML and Valid Markup?
on Sun, Apr 9 2006 2:08 PM
I don't have any hard data to back this up, but it is my impression:
I think if you build your site using the design techniques surrounding XHTML + CSS, your code will be easier to maintain. It helps enforce (though, doesn't guarantee - you still need to know what you are doing) a separation between content and presentation. I don't know if you count developer time or code flexibility as "business value", but I do think they are benefits you gain with XHTML+CSS (when don't right).

Since my response is so wishy-washy, and includes caveats... your point is clear. This stuff "sounds" like a great idea, but I'm not sure how to back it up with a dollar value.
David Hayden wrote re: Business Value of XHTML and Valid Markup?
on Sun, Apr 9 2006 2:28 PM
Joshua,

I 100% agree with using CSS for maintainability. I can give countless examples of how much time and energy I have saved in maintenance keeping the design separate from the content.

However, to the best of my knowledge, one can use HTML and CSS and get all the benefits of maintainability without using XHTML and having valid markup.

Although I have been taking the time to properly use and maintain valid XHTML on my new websites, I wonder if the customers are really seeing a value from it. I know I haven't been able to convey a business value other than just "bragging rights" in saying we are using XHTML and it is valid.
MB wrote re: Business Value of XHTML and Valid Markup?
on Mon, Apr 10 2006 7:12 AM
The only defense I can come up with, is that valid syntax is the only thing that is guaranteed to be supported. It's kind of like using undocumented behaivior in programming - it may work now, but it may break with the next release.
That being said, I don't imagine IE breaking away from their legacy parsing of invalid (X)HTML - way too many people would hoot and holler.
In the end, I guess I would have to agree with you. There's no current value in rewriting existing markup - but new markup should be validated against XHTML, simply because that's the current standard. But hey, what's wrong with that? A lot of times, we code against standards without knowing what the result will be. But, the fact that everybody is (roughly) targeting the same standard allows for some interesting evolutions. Look at the whole mashup phenonema for a current example....
Jason Haley wrote Interesting Finds
on Mon, Apr 10 2006 8:20 AM
Michael wrote re: Business Value of XHTML and Valid Markup?
on Mon, Apr 10 2006 11:20 AM
Scanning through the errors produced by the validator is still a good practice, though.  Many can be ignored (for now), but, for example, Codebetter.com is using only the "language" attribute for your script block, which has been a no-no since before the current GenX ever heard of HTML.

I believe the goal of structured, valid syntax to be essential to the development of future technologies.  Yes, you can say that XHTML isn't saving you money, and you'd be right.  All modern browsers will accept error-riddled HTML, and so the time and effort required to conform to XHTML is uncessary, strictly speaking.

However, as industry professionals, we should be concerned about the direction of technology overall.  HTML has long been in the hands of amateurs and professionals alike, and so has become the too flexible and forgiving.  If we are to use web content in more varied and advanced ways, we need to put an end to it.

Surely you can see the benefit to being able to parse web content consistently and accurately?  We're not just talking about simple browsers running on Windows XP or Mac OS X.  Going forward, we'll see content being parsed by a variety of visible and invisible systems, and progressively more complex and advanced browsers and the like.  We need to stop fooling around with the Internet as an interesting toy and start to mold it into a stable (in some senses of the word... innovation is still the heart and soul of the Internet), functional tool.

Yes, it's cool that my girlfriend or a random geek hobbyist can whip together some nasty looking HTML and contribute information globally with little effort, but one look at the code generating and consuming HTML shows that sanity will soon leave is if we have to deal with things as they are for much longer.

I dunno... just thinking out loud.  I think we need XHTML not for immediate short-term revenue, but for long-term investement in the overall improvement of web technologies and software development.  I believe the mindset of any technical professional who believes otherwise is destructive to our industry.

No offense... I could be wrong ;)
Brian wrote re: Business Value of XHTML and Valid Markup?
on Mon, Apr 10 2006 1:54 PM
By moving to XHTML you can more easily support mobile browsers, and other user agents. There is great overhead in writing parsers/crawlers so supporting edge cases (invalid html) is expensive.

More structure to the HTML, also enables you to provide things like microformats.

The whole business value of XHTML, CSS and standards compliance has been blogged to death. I think people have to just accept XHTML as the standard for all Web work and learn to work with it, rather than re-open arguments around business value.
David Hayden wrote re: Business Value of XHTML and Valid Markup?
on Mon, Apr 10 2006 3:38 PM
MB, Michael, Brian-

I appreciate the input.

I think we are all on the same page. As developers there is no question we should be building all new websites using XHTML and that as the future unfolds we will start to see some cool benefits of it.

I regularly validate my XHTML using the W3C validator and think it should be a best practice. Some of the validation errors on CodeBetter could be easily fixed and some violations are more of a problem than others :)

It's good for me to just know that my gut feeling was right - there isn't a huge business benefit to it right now, but mainly a good practice that as professional web developers we shouldn't ignore.
Jeffrey Palermo wrote re: Business Value of XHTML and Valid Markup?
on Tue, Apr 11 2006 11:52 AM
I'm glad you posted about this.  I use XHtml markup in my applications.  The first and obvious reason is browser portability.  If you use Html, the different browsers have different rules for interpreting markup.  With XHtml, if you mark your page as XHtml 1.0 transitional, then the browser will apply the standard xhtml rules when rendering (even if you have some small, minor errors).  This makes laying out the page so much easier, and it looks the same in multiple browsers.  Working with CSS is also easier because browsers will interpret CSS differently if you have your page labeld as html4.  Not everything is different, but enough to be annoying.  Using XHtml allows me to go faster.  That's business value.  The business doesn't really care about standards.  They care about functinality.  XHtml helps me do my job better, and that translates into value for the business.
David Hayden wrote re: Business Value of XHTML and Valid Markup?
on Sat, Apr 15 2006 7:59 PM
Jeffery,

That's an interesting point of view.

I have actually found that most browsers are very forgiving with invalid HTML markup. One might argue it is just as easy if not easier to create invalid markup. If you look at the markup errors on CodeBetter using the W3C Validator, you will find it is missing end tags in some cases, but still the browsers are rendering the output just fine.

I am also not sure how CSS will be any different whether you are using XHTML vs. HTML. The CSS specification, which I believe is separate from the HTML and XTHML specifacation, shouldn't be any different. You either have this right or not, so my guess is the browsers don't care if you are using HTML or XHTML. And, just as with HTML, the browsers are probably very forgiving with CSS as well.

I still don't see the business value, just bragging rights. Don't get me wrong, I review my sites often for XHTML validation errors.
Devlicio.us