How do web templates separate content and logic?

bruno.desthuilliers at bruno.desthuilliers at
Mon Jun 30 23:13:30 CEST 2008

On 30 juin, 21:34, Mike <ter... at> wrote:
> On Jun 30, 1:49 pm, "bruno.desthuilli... at"
> <bruno.desthuilli... at> wrote:
> > > Then what is so *good* about it, why embedding HTML into Python is not
> > > good?
> > Who said embedding HTML in Python was bad ? Did you _carefully_ read
> > John's question ?-)
> I should have say "why embedding HTML into Python is not good
> enough?" ;=)

Every time I took this road (be it only because I was too lazy to
install and set up an existing templating package), I ended up writing
yet another half-backed templating system.

> > wrt/ what's so good about it: web designers are usually better at
> > working with this approach (whatever scripting language embedded in
> > html) than they are writing Python code - either as plain strings or
> > using a more declarative syntax like the one provided by Stan or
> I keep reading this argument that some mythical 'web designers' are
> usually
> better at working with this abracadabra (TAL etc.). BTW, most of the
> times
> it is used by programmers :).

Your experience. Not mine. In my shop, 80% of "template code" (from
ZPT to raw PHP including various templating systems) is written by web
designers. Same pattern in my previous shop FWIW.

> > equivalent html generators.  But nothing prevents you from using
> > Mako's internals directly if you find it easier and more
> > maintainable !-)
> Yea, that is a perfect and universal advise - use whatever fits you
> best!;:=}

Which is probably why all designers I know prefer the 'script in html'
approach - it fits how *they* perceive dynamic html generation : it's
html *plus* a couple simple instructions/special markup/etc to handle
the dynamic part.

More information about the Python-list mailing list