The Good Life... a weblog about life, technology, and the Opera Web browser

Posts from March 30, 2006

Date
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

Friends don't let friends write bad code

A while back, I received the following e-mail from a colleague:

This is an intervention.

The <q> element should only be used for quotations. To ensure correct usage of the <q> element, always use the "cite" attribute when using a <q> element (or a <blockquote> element). If there is no "cite" attribute that makes sense, then <q> is the wrong element.

I think we need to have more interventions like that on the Web. If you look a page's source and wince at the <table> elements used for layout or the gratuitous use of <div> elements, send the author an e-mail. Don't just squirm, do something about it. And certainly, certainly write good code yourself.


Disclaimer: I don't admit to writing 100% semantic code, but I know I've improved over the years, certainly due to hints from friends and colleagues. I also know that my current site isn't very semantic and I hope to fix that at some undisclosed point in the future when I move away from a canned theme.

PS: Naturally, I put the above quotation in a <blockquote> element. I can't cite the source, since it's from a private e-mail. Is that so wrong?