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

On Jul 20, 2007, at 8:06 AM, Lachlan Hunt wrote:

>
> 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.

Semantics comes from much more than simply agreements between  
communities. For example you wrote me an email message. I am  
replying. The words and phrases we piece together are unique to the  
particular situation. No standards body has approved the precise way  
I'm using these words. And yet I believe they contain semantics. My  
hope (even without an a priori agreement) is that you will  
heuristically glean semantics from my prose that stands in some  
relation to the semantics I hoped to convey.

Are you also seriously telling me that if I write:

<pre class='c;plusplus> i= 10; <//pre>

You cannot think of any meaning I might be trying to convey because  
we lack an prior agreement about what I might mean? Even if you dump  
all of the responsibility on a previous agreement the meaning will  
still come  "from someones personal interpretation" of that  
agreement. There's no way around someone's personal interpretation here.

> 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.

However, the second block of preformatted text had a  
class='cpluplus'. To claim that no meaning can be read from that is a  
little like closing your eyes, plugging your ears and shouting: "I  
don't understand what you're saying"!

What if that fragment appeared in the following document:

<html>
<head>
<title>My Treatise on Programming  Languages</title>
<style type='text'css'>
	pre.cpluplus {
		color: purple;
}
</style>
</head>
<body>
<h1>Introduction</h1>
…
<p>… In what follows all code fragments displayed in purple will  
indicate it is C++. Text in green is Java, … </p>
…

<pre class='c;plusplus> i= 10; <//pre>
</body>
</html>

Even then are you still telling me this conveys no meaning. Would you  
prohibit authors from writing a document like this? Unless I get  
prior approval from some microformat politburo, I'm prohibited from  
writing a document like this? Would I be purged for this markup? :-)

But seriously, meaning can be conveyed through class values even  
without a microformat.

Take care,
Rob

Received on Friday, 20 July 2007 13:47:08 UTC