Link text

The Truth About DOCTYPE

There is a lot of commotion over the state of markup specifications these days. Many strong opinions have been voiced, and objected to vehemently. The debate has raged for years and shows no signs of slowing.

You may come away from the banter asking “which is the one to rule them all?”, or perhaps your opinion is already solid. You want to use XHTML 1.1? Go for it. HTML 4.01 Transitional? Okay. XHTML 1.0 Strict. That’s fine too.

It doesn’t matter.

The cold reality is that while you absolutely should write clean, semantically correct markup, the doctype you choose doesn’t really matter. You’re skilled enough to make a nice looking page regardless of the doctype — right? Your visitors don’t care which you use. Google doesn’t care. Your boss doesn’t care. So, why should you?

Instead, spend time improving your markup, understanding the nuance of good semantics, and writing your code by hand. Some people may have a technical restraint that dictates they use a certain spec. Fine. Just pick one that works for you and use it. HTML. XHTML. Strict. Transitional. Whatever.

It doesn’t matter.

Modern browsers (and IE 6) understand HTML 4 and XHMTL just fine. Sure, there are quirks. Learn them and learn how to work with them. If you’re either lucky or brazen enough to be able to ignore IE 6, HTML 5 is fine, too. The merits and perils of each have been thoroughly discussed elsewhere. The people pushing the debate are all very well qualified, have lucid arguments, and vast experience. Perhaps most importantly, they have the ears of the brain trust in the ivory towers where specs are authored. Let them handle it.

You want to push for web standards? Great. You can do that by adhering to your chosen spec and writing clean code. Web standards are just a loosely held set of best practices, not a dogma for XHTML. Try to get a standardista to tell you which is better — HTML or XHTML. I’ll wait.

You want to validate your code? Awesome. Do that. The W3C validator works on over 20 known doctypes. You should be validating your code as a debugging and learning tool, not a license to berate other developers who’s code doesn’t pass muster.

Focus on your content. Engage your visitors. Spell check your copy. Learn the art of design. Analyze your traffic. Improve your Web site’s accessibility. Get a latte. Whatever you do, don’t agonize over your doctype, or anyone else’s.

It doesn’t matter.