[Zope] The new DTML syntax

Jim Fulton jim@digicool.com
Mon, 09 Aug 1999 10:43:12 -0400


Alexander Staubo wrote:
> 
> The discussion could not have happened a month ago because nobody had
> spent any serious amount of time with the syntax. Time is not an issue
> here, or at least it shouldn't be. We're talking about a feature of Zope
> that, once established, we'll be living with for ever after.

The new DTML syntax was announced June 15.  I think that one
month ago, there was ample time to try out the new syntax.

At this point, quite a few people are using the new syntax.
Further, since we are now in the beta release cycle, we would
not be justified in removing this feature. So, if we wanted to
support a new spelling, we'd have to support it in addition to
the SSI and '<dtml-' varieties.  This isn't very appealing.

> Besides, migration problems isn't the issue. I don't see the difficulty.

I see a big problem. Lot's of people have code using the dtml-xxx 
spelling.

> There's no particular reason why Zope shouldn't be able to apply the
> changes automatically, for example.

Zope then has to support three variants.  This is really unappealing
from a documentation and support point of view.
 
> My contention is that the new syntax is significantly less readable and
> far too verbose. It's not really about keystrokes (the new syntax three
> characters shorter than the SSI syntax). The new syntax detracts from
> the idea of DTML as an expressive language -- why, if I had to prefix
> every word I spoke with the word "dtml", that wouldn't be so great.
> Because dtml-eventually dtml-you'd dtml-have dtml-to dtml-learn dtml-to
> dtml-filter dtml-out dtml-the dtml-dummy dtml-words. But in the world of
> natural languages, "dtml-if" isn't a word; it's two words; we learn, by
> convention, to split such hyphenated constructs into separate words. Our
> mind works best with individual words. Why go against the grain and
> teach the brain a new thing?

I don't agree with your assertion that the new syntax is less readable
than the SSI syntax.  I had lots of positive feedback when I proposed
the new syntax.  While a number of people have expressed a preference for
z-if over dtml-if, I haven't seen many people express a 
preference for SSI.

I happen to like the two-word reading of dtml-xxx.  You get to reuse
an existing vocablary, including words like 'if' and 'in' and add
a descriptive word, 'dtml' to provide context.  This is why I switched
to using a hyphen (as suggested very early on by Jeffrey Shell) 
rather than an underscore, which is what I first used.
 
> Afaik, there's no technical reason to prefer the "dtml-" prefix to
> something like "z-" or "dt". Is "dtml-in" somehow more unique in the
> world of markup languages than "dtin"? In the future when we're using
> XML namespaces, will we be writing "dtml:dtml-in"?

I don't think that there is an overwhelming technical reason to prefer 
'dtml-x' over 'z-x'.  OTOH, I don;t think there is an overwhelming reason 
to pefer z-x either.  I think that 'dtml-var' is much better than 
'dtvar' from a readability point of view.
 
> I'm not surprised that DC dominates the negatively-charged end of the
> discussion, but this is supposed to be an open-source development
> project, so I suggest a good, clean discussion on the topic and then a
> vote.

I once asked on the Python list what constituted "flaming".  Tim
Peters gave, what I thought was a very sound definition. He said that
you could spot flaming by looking for meta-discussions, discussions
about discussions, as a sign of flaming.  I think that the best way
to have a good clean discussion is to stay focussed on the practical 
merits (technical and non-technical) of proposals and ideas.

Finally, I'll point out that the coming XML variant of
DTML will make this discussion moot, at least if you use the 
XML variant.  With XML namespaces, you will be able to use
whatever prefix you want, since the prefix is just a local
alias for a unique name.  So you can use 'z:if', someone else
can use 'dtml:if', and I can use 'jim:if'.

Jim

--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.