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

On Fri, 7 Aug 2009, Martin McEvoy wrote:
> Ian Hickson wrote:
> > Could you illustrate how this is the case in JavaScript?
> 
> foo=window.open("")
> foo.document.open()
> foo.document.write("<b>Some foo text</b>")
> foo.document.close()

On Thu, 6 Aug 2009, Othar Hansson wrote:
>
> or:
> 
> <script src="foo.js"></script>
> ...10K of html...
> ...10K of html...
> ...10K of html...
> ...10K of html...
> <script>
> bar("x");
> </script>
> 
> what's bar() do?  read foo.js to find out.

Variables are conceptually simpler, I think, because people conceptually 
envision them as first-class citizens whereas prefixes are just syntactic 
sugar.

Having said that, programming is far more complicated than writing markup 
should be, so even if that was exactly the same, I wouldn't like it as a 
precedent.


On Fri, 7 Aug 2009, Martin McEvoy wrote:
> > > for example: 
> > > http://microformats.org/wiki/hatom-faq#Why_does_hAtom_use_class_names_with_prefixes
> > 
> > Those are not indirection-based bound prefixes. They are just 
> > identifiers that happen to have a common beginning. That's a 
> > completely different kettle of fish.
>
> No I don't agree, hatom is a special case in microformats because it has 
> an implied logical model that rides along side the physical model

I disagree. hAtom does not have syntactic prefix binding. You can't change 
the prefix in hAtom and maintain the meaning.


> RDFa to my knowledge has never promoted anything other than using well 
> known and well used prefixes see: 
> http://rdfa.info/wiki/Best-practice-standard-prefix-names

It's not what's promoted that matters, it's what's possible.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 7 August 2009 04:35:08 UTC