[Zope] Re: Java re-invents DTML :-)
Kevin Carlson
khcarlso@bellsouth.net
Fri, 14 Feb 2003 09:23:24 -0500
Come on folks. There's nothing wrong with supporting two templating
languages. Quite honestly, dtml is much easier to learn for most and
has it's place in application development -- just as ZPT does.
One simple reason that dtml should be supported (in addition to the fact
that it works well) is for the support of existing Zope applications.
If Zope was to suddenly stop supporting dtml, it would cause many, many
people a lot of work if they wanted to get features available in a new
version of Zope. The argument could be made that they "need" to migrate
to zpt in the opinion of some, but that is not good business for Zope.
I don't know why there are a zealous few out there that want to
eliminate dtml from Zope. If you don't like it, don't use it. This is
technology folks, not religion. Oh yeah, my bad -- for some, technology
is religion. ;-)
With the proper discipline, dtml or zpt along with python can help
achieve good separation between logic and content. I've seen this same
argument over the last 20 years whether the language was C, C++, Java,
Prolog, Basic, Cobol, Pascal, etc. Trust me, crappy coding knows no
language barrier.
DTML and ZPT both have a place in Zope. Deciding which one to use
should be left up to the individual.
Kevin
Chris Withers wrote:
> Ausum Studio wrote:
>
>> Why the need to dispute? !
>
>
> People suggesting DTML still has a place in Zope.
> You shouldn't need to learn two templating languages and a scripting
> language just to use one web framework ;-)
>
>> Page templates aren't meant to support logic, right?
>
>
> No, and neither is DTML. But DTML makes it easier for you to think you
> can put application logic into it without being horribly burned later.
>
>> So, there you have
>> something that page templates couldn't do: when you do need logic and
>> content in a single method.
>
>
> You should _never_ _ever_ have content and logic in a single method!
>
>> Furthermore, I'd appreciate that you help me on this: How would you
>> perform
>> the following using ZPT or PythonScript?
>>
>> <dtml-in objectItems>
>> <dtml-var sequence-item>
>> </dtml-in>
>
>
> Jeez, this is documented and painfully simple:
>
> <tal:i repeat="item here/objectItems">
> <tal:x replace="item"/>
> </tal:i>
>
> Of course, you probably want to display that, so something like the
> following is more likely:
>
> <table>
> <tr tal:repeat="item here/objectItems">
> <td tal:content="item">Sample content</td>
> </tr>
> </table>
>
> In a python script, it'd be:
>
> for item in context.objectItems():
> print item() # this line might need ot be edited
> # depending on what the items are
> return printed
>
> Now, any other excuses why you think DTML should still exist? ;-)
>
> cheers,
>
> Chris
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>