Microformats: Boon or Bane?

I understand why there is this confusion about “CSS classes” - ASP.NET used to (it may still!) make you define class attributes in “controls” in templates as “CssClass” attributes. So not only were a generation of .NET developers incorrectly led up the garden path to believe that elements classes were just to be used as styling hooks, but because you were writing an abstract control that didn’t give you control over the exact mark-up that was output (and would thoughtfully re-write it for browsers it classed as “downlevel”!) CSS was often written as a series of classitis-suffering rules that looked like .pageContentBlogPostList etc etc.

Microformats, though, can form a useful hook for styling information. adr is a case in point - you may wish to style, say, city or state name in bold (if you’re wanting to visually emphasise one particular address part), or capitalise postal town, or whathaveyou) - so you adopt a language you can use throughout a site. They tend to be written by Americans, and so can suffer from a cultural bias (witness XFN, as I have previously lamented http://www.bedroomation.com/2008/04/03/web-things-that-must-die-2-xfn/). But, you know, for a lot of purposes they can be handy. They can be quick. Google can index 'em.

The main problem with microformats is, as you point out, they’re really difficult to write! Unless they’re simple (they seem to be most useful when they’re simple), or unless they map an already existing standard 1:1, they can be horribly over-simplistic. It may be that they can be seen as presenting a lowest common denominator, so at least Google can index up something meaningful that it can present to people alongside something essentially quite different. But they’re no grand unifying data format. The approach of doing it quickly and then moving on to something better to spend your time on is a good one.

Besides, shouldn’t we make computers do the work of computers? Apple Mail, for example, can recognise addresses when you type them in freeform. Is it really beyond web frameworks to implement libraries that can take freeform addresses and, as best they can, render them into microformats like adr? That’s the job of code! If microformats are designed for humans first and computers second, you have to ask: exactly which humans were they designed for?

The microformat css class names may overlap with existing css classes. Woe betide the poor developer who has to retrofit a microformat on an established site where “locality” or “region” have already been defined in the CSS and are associated with elements all over the site. And let me tell you, many of the microformat css field names are, uh, conveniently named what you’ve probably already used in your HTML somewhere. In the wrong way, inevitably.

This isn’t that big a deal, you can specify and override those styles using “adr locality”. Granted, not ideal, but I don’t see it having that big an impact.

There’s no visual indication whatsoever that any given css class is a microformat. If you hire a new developer, how can they possibly be expected to know that “postal-code” isn’t just an arbitrarily chosen CSS class name, it’s a gosh darned officially blessed microformat? What if they decide they don’t like dashes in CSS class names and rename the style “postalcode”? Wave bye bye to your valid microformat. If it seems fragile and obtuse, that’s because it is.

Maybe, I’m naive, but I’m of the opinion that any professional looking to interact with front-end code should at least be AWARE of Microformats.

You do have valid points, MFs are fragile and ambiguous, but you’re also back-to-front on what the class attribute should be used for.

The class attribute has never been the exclusive domain of CSS, at least in my mind. I have used it for years to call out a similar groups of DOM elements. What is that word for a similar group of objects? Oh right, “class” is the word for which I am searching. I find the overloaded use of the class attribute here to be similar to how it is used elsewhere for the same purpose.

BTW, I miss orange.

“HTML5 and its mythical data attributes”? http://dev.w3.org/html5/spec/Overview.html#embedding-custom-non-visible-data (dated today, 12/10/2009) implies they’ll be quite happy in reality-land.

After reading this post I can safely say that you sir are no data modeler.

Browsers work great for navigation and presentation, but we can only usefully compute with structured data. Microformats combine the virtues of both.

Microformats are great for linking multiple web resources with each other and with desktop apps. Say, you browse the website of your favorite Jazz club. You notice a show you’d like to see. You click a button to add the event to your calendar (either web based or a desktop app). The Operator extension for Firefox does things like this.

Enabling the user to mix and match data sources and easily combine multiple web apps into workflows is the future of the web as an application platform and microformats are a step in that direction.

Read more about microformats here: http://digitheadslabnotebook.blogspot.com/2009/12/microformats.html

-Chris

A bit more about my point of view:

http://forthescience.org/blog/2010/05/12/about-class-attributes-semantics-and-microformats/

Could you fix these links?

  • http://www.codinghorror.com/blog/images/google-microformat-results-forum.png
  • http://www.codinghorror.com/blog/images/google-microformat-results-review.png

Thanks