« Time flies | Main | Google numbers »

Language Game

Christopher Lenz's point about needing presentation logic is on the money, so why not go a little further: "Why Not Just Allow Python in Templates?"

Fair enough - here are some things to think about:


July 19, 2007 01:16 PM

Comments

walter
(July 19, 2007 11:25 PM #)

Terrence Parr espouses ORM in that paper. I've seen way more ORM sins than Template sins.
Personally I hate the mini-language approach to Templates and much prefer Templates that let me use the full host language.
this made me smile...
"While JSP was not the answer, it did put the idea of a template
into programmers’ minds."
... I'm pretty sure templates were around for some time before JSP.
I'd agree with Christopher Lenz's point. Java/C/C++ and HTML make terrible bedfellows, but that's not to say Python or (dare I say it) Perl couldn't coexist with HTML.

(July 20, 2007 01:33 AM #)

You can include Python in Mako templates, to name just one.

I tend to prefer it because invented template syntaxes are prone to falling into the Turing tar-pit: look upon MediaWiki and despair.

dak
(July 20, 2007 10:35 PM #)

There's an enormous gap between the claims "presentation logic is necessary" and "presentation logic should be in the template". The template can be entirely passive if it is reflected into the controller as a data structure. The controller can then manipulate blocks of output in the template by hiding them, replacing their contents, and/or repeating them. This simple mechanism provides all the power you need, while keeping the presentation logic separate from the template. Small extensions make this system very nice to use.

Post a comment

(you may use HTML tags for style)




Remember Me?

Trackback Pings

TrackBack URL for this entry:
http://www.dehora.net/mt/mt-tb.cgi/2122