Standards are (nearly) irrelevant.

In a discussion over at molly.com, Fergus Wilde asks which standards to use:

… I’m keen to ‘do the right thing’ - but what is the right thing? What’s the most useful, correct, forward looking standard I can employ that won’t leave our largely non-tech user base stranded? Even most of the open source tools still make it a deal easier to use html 4.x than xhtml 1.1, into which I’m looking.

I have a very simple, straightforward answer to this:

It does not matter which standard you conform to. Do whatever suits your needs best. It doesn’t really matter whether you use HTML 4.01 Strict or transitional, XHTML 1.0 or 1.1. Just do the right thing with the standards you have chosen to conform to.

So, what is doing the right thing then?

  • Understand that HTML and XHTML defines both syntax and sematics.
  • Understand that syntax and semantics are equally important. Having a syntactically correct document doesn’t help if you litter your documents with <span class="red">Important!</span> <div style="font-size: 200%">Heading</div> everywhere. Neither does it help if your documents are semantical masterpieces if you put <h2>Very <em>important</h2> heading</em> in your document.
  • Where you can choose between implicit and explicit syntax: Choose explicit syntax:
    • Don’t omit optional start tags.
    • Don’t omit optional end tags.
  • Don’t use the latest and greatest standard, just because it is the latest and greatest standard. There is absolutely no need to use XHTML 1.1 unless you need Ruby annotation - likewise:
    • Unless you parse your own output using an XML parser, or plan on inlining XML data, such as MathML or SVG, you don’t need XHTML at all.

This site uses XHTML 1.0, something I, in hindsight, regard as a huge mistake. I don’t need XHTML. I don’t produce MathML, I don’t use SVG. I don’t parse any of the HTML output with an XML parser. I should really, really have chosen HTML 4.01 Strict.

Comments

Comment from Anne on 2005-01-31 21:42

What is wrong with omitting tags? I love it.

Comment from Arve on 2005-01-31 21:57

Anne: EvilML

Comment from Asbjørn Ulsberg on 2005-02-01 01:06

Omitting tags is just cruel. I can’t see any good reason why anyone in their right minds would choose to omit tags. Explicit is always better than implicit. Always.

Comment from Anne on 2005-02-01 23:30

Arve, that is not only omitting tags. That is using some shorthand features of SGML which are not supported by popular browsers.

Asbjørn, omitting tags makes authoring easy. That is a reason for me to do it sometimes.

Comment from Arve on 2005-02-01 23:54

Anne, I should probably have been more explicit: Omitting tags impairs readability of markup. It creates obfuscated documents. The more you obfuscate, the more likely it’s for a UA to get it wrong.

(Of course, I don’t know in which scenarios you are omitting end tags, but if that scenario is manually created markup most sane text editors should let you insert both start and end tags easily. For instance, myself, I type #div to get <div>^!</div> (where ^! is cursor position.))

Comment from Freexe on 2005-02-02 16:36

Arve, what html editor do you use?

Comment from Arve on 2005-02-02 17:22

The one doing what I’m suggesting here is EditPlus, but mostly I’m on Emacs.

This discussion has been closed. No further comments may be added.