The evolution of templating systems

December 19, 2002

There's an interesting intersection happening between two worlds: WebObjects and Zope, brought about by Marc Hedlund's posting on O'ReillyNet, Why JSP Sucks So Hard.

He feels JSP (and by extension PHP, ASP, etc) doesn't go far enough in separating code from content, and that a JSP file is still totally hostile to a web designer who isn't a programmer. (I agree)

He suggests a templating system that physically separates code from content in a template by putting them in separate files, binding them together using CSS, and having the templating system parse out the backend bits during rendering.

Interestingly, this is how WebObjects does things, with a component comprised of a .html file and a .wod (bindings) file. It doesn't use CSS syntax in the .wod file, however, but I'm not sure it really matters what the syntax of the code/bindings file is, just that it's not in the .html file.

So WO is part way there. And so is Zope, but with a different take on things, with their Zope Page Templates (ZPT) and Template Attribute Language (TAL). ZPT/TAL unfortunately puts the "code" in the .html file, but rather than using weird tags like JSP or WebObjects, it puts them inline, in namespaced attributes of standard HTML tags which their backend renderer processes and strips out. ZPT/TAL is WYSIWYG editor/designer friendly, to a point, but only marginally more than JSP.

One person commented on the ORA thread that Evan Simpson proposed the CSS/TAL link earlier this year. Very interesting! Evan and Marc's proposal gives the best of both worlds -- physical separation of HTML from backend code, like WO has, and the use of standard HTML tags and attributes, like ZPT comes so close to having.

I posted my thoughts and a brief explanation of the WO way in reply on the ORA thread.

I really hope this idea gets implemented.