[Zope-dev] DTML is not simple

Ken Manheimer klm@zope.com
Wed, 8 May 2002 14:14:16 -0400 (EDT)


(I missed the start of this topic, plz forgive me if i belabor what's 
already been said...)

> Jim Penny wrote:
> > 
> > But, I also agree with Adrian's thrust, DTML is a simple useful
> > language, that, ignoring the quoting problems and all the _ namespace
> > magic, can be picked up by anyone with an imperative language background
> > in a couple of days.  (Now, the quoting problems are indeed gross).
> > There is also far too much magic in DTML, especially in name lookup.
> 
> So you see, DTML isn't actually simple ;-)
> 
> It appears simple, until you try and do anything useful with it.
> Then, all of a sudden, you have to use the quoting, the _, and you have to try and make
> sure you're <dtml-var some_variable>'s are coming from the right place, not calling
> something when they don't mean to, etc, etc...

As far as i'm concerned, DTML's ideosyncracies are insignificant compared
with the fact that DTML tries to intermix procedural and layout/templating
languages, which is fundamentally flawed.  It can certainly be useful -
like 'goto' can be useful in programming - but you lose crucial benefits
of structured code in the process.

You can still *program* with DTML - as you can still program with 'goto' -
but you're dealing with a structuring mixture whose bizarreness doesn't
help, and often hurts.  The fact that you can close a DTML loop containing
only part of an HTML element - eg, part of a table cell, or even part of
an HTML tag - offers the kind of freedom whose cost is guarded against 
by principles of structured programming.

ZPT, on the other hand, uses the template structuring as the code 
structuring - it reconciles the two.  This constraining means that 

  - The code can be checked for syntactic correctness

  - People familiar with just the layout aspects are not totally mislead, 
    confused and thwarted by the added programming elements.

  - People working with the programming elements don't get thwarted 
    by the layout people's (or their tools') unknowning disruption 
    of the programming code.

  - Probably most important, in my view as a programmer, is that people
    working with the programming code can *adjust* what's there
    without going crazy trying to track down how it was supposed to
    fit with the layout code according to arbitrary, ad-hoc coupling.

Like i said, i think this debate is very like the arbitrary-goto
programming issue which was laid to rest years ago - see dijkstra's "Go To
Statement Considered Harmful", from 1968, for a classic account (it's
reprinted as an ACM "classic of the month",
http://www.acm.org/classics/oct95/ ).

(I'm fond of saying that ZPT does well the thing which makes zope excell -
good impedence matching - and DTML does *not*.)

-- 
Ken
klm@zope.com