W3C home > Mailing lists > Public > public-html@w3.org > July 2007

Re: (code, sample output and keyboard/device input <code>, <samp>, <kybd>) part of my review of 3.12 Phrase elements

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Fri, 20 Jul 2007 23:06:14 +1000
Message-ID: <46A0B346.8020703@lachy.id.au>
To: Robert Burns <rob@robburns.com>
CC: Anne van Kesteren <annevk@opera.com>, HTML WG <public-html@w3.org>

Robert Burns wrote:
> On Jul 20, 2007, at 5:48 AM, Anne van Kesteren wrote:
>> On Fri, 20 Jul 2007 08:55:48 +0200, Robert Burns <rob@robburns.com> 
>> wrote:
>>> The <pre><code> example seems  like less than best practice. Why not 
>>> simply use <code style='white-space: pre;' >some code with 
>>> line-breaks</code> or even just <pre class='c-plusplus-code' >some 
>>> c++ code here</pre>. Either of those contain the same or more 
>>> semantics without adding another level to the hierarchy.
>>
>> The latter doesn't give you any semantics unless you define some 
>> microformat.
> 
> How does:
> 
> <pre><code> some c++ code here.</code></pre>
> 
> provide more semantics than
> 
> <pre class='c-plusplus-code' >some c++ code here</pre>
> 
> Are you really saying that if a microformat doesn't tell you what I 
> mean, you cannot discern anything from that source code.

Semantics comes from the agreement between the creator and consumer of 
the content, not from someones personal interpretation of the class 
names in the source code.  The microformats community provides such 
agreements for a variety of class names.

The spec defines the meaning of both <pre> and <code>.  The first 
example is defined to mean a block of computer code, the second is just 
a generic block of preformatted text.  However, whether or not that 
distinction is actually useful, is certainly questionable.

-- 
Lachlan Hunt
http://lachy.id.au/
Received on Friday, 20 July 2007 13:06:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:02 GMT