Home Login Create account Contact Help
Close

Login to your account

Other Options

Comments feed

In response to Practicality versus Purity in Python templates

There are a number of very powerful template languages available in Python. Some template languages, such as Genshi [genshi.edgewall.org], allow complex Python statements and even full Python code within the template file. Others, such as Django [djangoproject.com] templates, prefer to restrict templates to presentation only and do not allow general Python expressions within the body of the template.

In the context of a web framework, is it better to have the full expressiveness of Python, or restrict templates to presentation only?

...

NB. You can post code with the [code] bbcode tag. Many languages are supported. e.g.

[code python]

print "Hello, World!"

[/code]



Lennart Regebro argues for "Expressive Python"
Thu, 28 Feb 2008 by regebro
Rank 2. Average -0.2 ( 4 votes )
Expressive templates lets you be lazy.

Expressive templates makes for messy and unmaintanable code. Well, not all code needs to be. Expressive templates lets you be lazy.

Will McGugan comments...
Fri, 29 Feb 2008 by admin
Is laziness a good thing? I'm all for writing less code, but laziness implies there is something else the template author should be doing. Something that would avoide messy and unmaintainable code...


Return to debate