[Zope-dev] DTML is not simple

Chris Withers chrisw@nipltd.com
Wed, 08 May 2002 09:36:38 +0100


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

> ZPT is, in fact, a much more controllable artifact.  It is also ugly,
> and almost completely non-intuitive.  

Well, come up with something more intuitive then, and less ugly, which actualyl solves the
problem :-) I think ZPT is pretty good considering how difficult the problems are it's
trying to solve...

> It seems far harder to map to
> conventional languages.

Such as? I don't think that an improtant requirement is for a templating language to look
like a programming language. If that's the case, why not just use Python Scripts and
string substitution?

> In fact, I am wondering if ZPT
> code may not prove to be harder to maintain, mostly because I have real
> trouble finding the tal: statements while scanning the program. 

Just use a normal HTML syntax highlighter. 

> In
> particular, tal:repeat seems nowhere near as easy to find as <dtml-in>.

I actually find the opposite true ;-)

> I suspect that a great deal of my problem is that ZPT is an infix or
> a suffix-like notation, where DTML was a prefix notation.  I am used
> to skipping infixes to some extent, especially on first reading.

Well, this kindof supports a feeling I have that DTML actually forces you into a pattern
of thinking incorrectly. I have seen no new Zope users complaning about ZPT, I have see
plenty of new Zope users getting baffled and confused by DTML, I remember, I was one of
them!

> The biggest change for the better that I see is that it is now easy to
> use a script (Python) [still lobbying for Snake Thingie] as index_html.

yup :-)

cheers,

Chris