[Zope-dev] Re: ZClasses useful! [Was: ZMI / JavaScript brainstorm]
Jim Penny
jpenny@universal-fasteners.com
Tue, 7 May 2002 18:06:41 -0400
On Tue, May 07, 2002 at 05:35:55PM -0400, Shane Hathaway wrote:
> Adrian Hungate wrote:
> >Ok, ZPT is easier that DTML? How do you code this in ZPT?
> >
> ><dtml-in objectIds() sort=id>
> ><dtml-var sequence-item>
> ></dtml-in>
>
> You have some good points, but there's a certain irony in the fact that
> the above code won't work. You either forgot to quote the "objectIds()"
> expression, or it shouldn't have parentheses, illustrating the first
> ugly thing most people run into when learning DTML. :-)
>
> Nevertheless, as you said, ZPT really does need some better way to
> implement batching and sorting. The need is too common to require
> external scripts or big Python expressions to do it.
>
> Shane
I agree with the irony and all that, and have tried several times to
switch to zpt. I am finally almost there.
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.
ZPT is, in fact, a much more controllable artifact. It is also ugly,
and almost completely non-intuitive. It seems far harder to map to
conventional languages. 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. In
particular, tal:repeat seems nowhere near as easy to find as <dtml-in>.
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.
I am going to be honest, I think I could probably do no better, given
the constraints of embedding in XML.
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.
Jim Penny
>
>
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope )
>