[uf-discuss] More responses to slashdot comments

Sho Kuwamoto skuwamot at adobe.com
Thu Jul 13 09:49:17 PDT 2006


While I agree that the use of the class attribute in microformats is
consistent with the intended use (i.e., to embed semantic information
into HTML), I think there are some subtle gotchas to consider.

My recollection is that when span and class were introduced, there 
were a lot of people who had some unease with the very existence of 
class, span and div, because it adds an orthogonal layer of semantics 
onto HTML. 

For example, what is the difference between: 
   a) This is an <em>emphasized</em> point
vs.
   b) This is an <span class="emphatic">emphasized</span> point

Presumably, (a) would be preferred over (b), although I personally
prefer (b). (I think strong and em are copouts, but that's a whole other
story).

It gets even more confusing when you mix tags and classes more
aggressively.

Example A:
--
<div class="hreview">
 <span><span class="rating">5</span> out of 5 stars</span>
 <h4 class="summary">Crepes on Cole is awesome</h4>
 ...
</div>

Is the h4 the "structure" that defines the semantics of the document, or
is the "summary" class the structure that defines the semantics? 

In other words, why not do this:

Example B:
--
<div class="hreview">
 <span><span class="rating">5</span> out of 5 stars</span>
 <span class="summary">Crepes on Cole is awesome</span>
 ...
</div>

Ostensibly, the reason for preferring example A over example B is that
there are two systems of semantics for two different reasons. The HTML
view of the document says that the header is an h4. The microformats
view of the document says it's a "summary". Example A allows both views
of the document to live together.

What's the problem with this? Well, you'll notice that the HTML document
has become polluted by the div and span tags. Are the span and div tags
part of the HTML semantics, or are they just scaffolding to hold the
microformat information? In other words, should we ignore the span and
div tags when interpreting our document as HTML? 

This is essentially the same issue that people have with hacks like
adding <div class="topleft"> into a document, which is clearly
presentational. While the microformat tags are not presentational, they
are a different, orthogonal set of semantics that is being embedded into
the document, which can make it hard to know how to interpret the
semantics of the HTML tags.

Anyway, I think the above arguments are not a reason to discount
microformats -- the benefits outweigh the costs. But I do think there is
a valid point to consider here, which is that mashing two (or more)
systems of semantics together comes at a cost.

-Sho


 

-----Original Message-----
From: microformats-discuss-bounces at microformats.org
[mailto:microformats-discuss-bounces at microformats.org] On Behalf Of John
Allsopp
Sent: Wednesday, July 12, 2006 5:50 PM
To: microformats-discuss at microformats.org
Subject: [uf-discuss] More responses to slashdot comments

Tantek (and others)

As I have too much time on my hands :-) Another draft response to  
some /. comments

[SDC=Slashdot comment, MFR=Micrformats response]

SDC: Mixing presentation and data - good... bad... good. But it gets  
better a little, each time (maybe more of a spiral than a wheel).
SDC: Ok, so this "microformats" thing is about encoding extra data  
inside an HTML file by abusing CSS class names for markup, isn't that  
completly unnecessary and nothing more than an ugly hack?

MFR: Several slashdot comments carry in essence the same criticism as  
these - that microfomats, abuse the class attribute, and by doing so  
mix presentation with document structure. This demonstrates a  
misunderstanding of the class attribute of HTML. The class attribute  
is very commonly used by web designers in conjunction with CSS to  
style pages (which is one of the roles outlined for it in the HTML  
specification [1]), and in truth, it is often overused in this way.  
But despite that, class, according to the HTML specification "has  
several roles in HTML", including "for general purpose processing by  
user agents" [1].
Microformats make use of this second aspect of the class (and id)  
attribute, and do so legitimately. It is not an abuse of the class or  
id attribute to use it to add semantic context to a document. Nor is  
the use of class in and of itself presentational - in fact, it is an  
important mechanism for separating presentation from structured content.

[1] http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

john

John Allsopp

style master :: css editor :: http://westciv.com/style_master
blog :: dog or higher :: http://blogs.westciv.com/dog_or_higher
WebPatterns :: http://webpatterns.org
Web Directions Conference :: Sydney September 28-29 :: http://wd06.com


_______________________________________________
microformats-discuss mailing list
microformats-discuss at microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss


More information about the microformats-discuss mailing list