W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > August 2009

Re: Why bound prefixes are an anti-pattern in language design

From: Danny Ayers <danny.ayers@gmail.com>
Date: Thu, 6 Aug 2009 03:19:27 +0200
Message-ID: <1f2ed5cd0908051819u501cd3b1kceef91caa38b605e@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: Martin McEvoy <martin@weborganics.co.uk>, RDFa Developers <public-rdf-in-xhtml-tf@w3.org>
2009/8/6 Ian Hickson <ian@hixie.ch>:

Sorry Ian, but your arguments here are a bit rubbish.

> On Wed, 5 Aug 2009, Martin McEvoy wrote:
>> >
>> > (Of course, I personally would strongly argue against any prefix
>> > mechanism. But that's another story.)
>> I have never understood your stance on prefixes, to me and many others
>> they are a "feature" of the future web as well as the present, even
>> html5 uses prefixes i.e: data-* so why you think they are OK in some
>> cases and not in others seems a little inconsistent to me but that my
>> own personal view.
> My stance is against mechanisms that bind arbitrary strings to other
> arbitrary strings, which can then be used in conjunction with a third set
> of arbitrary strings to form a identifier that is never explicitly stated
> in the source.

I don't know where you get the 3rd set from, but syntactically binding
short strings to longer strings is a successful technique in software
engineering. Import antigravity.

> data-* isn't such a mechanism, since "data-" isn't explicitly bound to
> anything, and doesn't mean anything but "data-".
> I have a problem with mechanisms that separate parts of an identifier for
> a variety of reasons.
> Copy-and-paste of the source becomes very brittle when two separate parts
> of a document are needed to make sense of the content.

Fair point, but does this outweigh the benefits of extensibility?

Copy-and-paste is
> how the Web evolved, so I think it is important to keep it functional and
> easy.

Yes, but it *did* evolve - what proportion of Web pages do you think
were created through c&p now?

> Prefixes are notoriously hard for authors to understand. As far back as
> 2004, Micah wrote "As the author of an O'Reilly book on XForms, I can
> report that 90% of the technical questions from readers involve confusion
> related to namespaces".

Yet most programmers somehow seem to get their heads around namespaces
for their libraries, and XML namespaces has not-insignificant

>   http://www.w3.org/2004/04/webapps-cdf-ws/papers/verity.html
> Parand Darugar has said similar things: "Experience shows XML namespaces
> can be a common cause of confusion and a major complicating factor in XML
> adoption."
>   http://www.ibm.com/developerworks/library/x-abolns.html
> Fundamentally, prefixes are an indirection model. Indirection models are
> very, very hard for people to understand.

Spurious claim. The whole notion of a markup language is based on
indirection - the syntax is attached to some kind of dispatching
mechanism to interpret it - you don't get to follow a link by magic.

> Maciej has also said things to this effect: "Namespaces are an example of
> the Fundamental Software Engineering Error, which is that something too
> terrible to actually use can be fixed by adding a level of indirection.
> Sometimes that is true but software engineers try to do it even when it
> clearly is not."

Whether or not prefixes are appropriate for HTML5, your stance is not
solid. You might as well argue that there's no point in any
specification - why put a "<" at the start of a tag when you have to
indirect to a parser...

Hope I irritated you enough for you to think about this.


Received on Thursday, 6 August 2009 01:20:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:32 UTC