[Zope] Syntax: Learning from JSP's problems

Jim Fulton jim@digicool.com
Tue, 08 Feb 2000 08:23:06 -0500


Robb Shecter wrote:
> 
> Hi,
> 
> I think I saw somewhere that a new / alternate syntax for Zope/DHTML
> is being thought about or worked on.

I'm not sure what you are refering to.  We've considered for some time
allowing something like:

  <dtml-var a/b>

meaning "insert sub-object b of object a".

This is a good idea, but we haven't agreed on the semantics
of the '/'.  Some people assume attribute access. Others expect
URL traversal, along the lines of what the publisher does.
Others want URL traversal *and* publisher-style calling.

> If so, here's something that can give a push in (what I think is) the
> right direction:  There's some dissatisfaction in the Java servlet
> community re: JSP (JavaServer Pages), and one of the big reasons is
> the syntax.
> 
> This article compares JSP to a competing template language that does
> things (IMO) much better:
> 
> http://www.servlets.com/soapbox/problems-jsp.html
> 
> ...For me, the syntax of DHTML is the most difficult aspect of Zope,
> and is reminiscent of JSP.

That's interesting. From a purely syntactic point of view, 
this paper, favors a perl-style syntax rather than
an HTML-style syntax and argue that page designers would find
the perl-style syntax easier to understand. For example, the paper
argues that:

#foreach $isp in $isps {
    The next name is $isp.Name <br>
}

is more understandable by web-page designers than:

<foreach item="isp" list="isps">
   The next name is 
   <jsp:getProperty name="isp" 
    property="name"/> <br>
</foreach>

I find this hard to swallow.  Web-page designer's
tools will certainly have less trouble with the latter 
format than with the former. I certainly prefer:

<dtml-in isps>
  The next name is <dtml-var sequence-item><br>
</dtml-in>

to either of the above.

Leaving out syntactical details, I think the paper
makes some interesting points having to do with the basic
approach of JSP (and ASP).  JSP and ASP are fundamentally, 
though subtley, different from "template languages", like DTML
and the languages discussed in the paper.  Template languages
are new languages that make calls into an underlying object
system. JSP and ASP simply provide a shorthand for embedding
print statements into an underlying non-html language.

Basically, in rather non-obvious ways, a JSP or ASP developer
is *really* programming in Java or some other language, not
in an extended for of HTML.

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.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.