<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Python Template languages (Part 1 &#8212; Django)</title>
	<atom:link href="http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/feed/" rel="self" type="application/rss+xml" />
	<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/</link>
	<description>Thinking about programming in new ways</description>
	<lastBuildDate>Tue, 15 Mar 2011 02:30:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jacob</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323171</link>
		<dc:creator>Jacob</dc:creator>
		<pubDate>Fri, 11 Dec 2009 04:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323171</guid>
		<description>I don&#039;t think it is decidable in the abstract whether a &quot;salt umbrella&quot; is good or bad in general.  But for a particular set of site authors and maintainers, it may be clearly decidable.  My team stopped using django templates with django some time ago, because the template authors and the programmers are the same people, and hence there is no group of less experienced webmonkeys who need the protection of a sandboxed language (a language, incidentally, which is in some respects more intricate and harder to learn, while being less capable, than an uncrippled language like Python); and the cost of having to write a tag whenever you want to do almost anything besides interpolate just became silly.  So we&#039;re using mako, even with reusable apps from other sources (this is quite possible, via our django-smorgasbord app), and although mako syntax is in some respects less pretty than django&#039;s, it has been a big hit.  

I should stress this: Mark, you say that if you are using django you absolutely should use django templates -- but in my experience there has been no penalty to swapping them out with mako -- zero.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think it is decidable in the abstract whether a &#8220;salt umbrella&#8221; is good or bad in general.  But for a particular set of site authors and maintainers, it may be clearly decidable.  My team stopped using django templates with django some time ago, because the template authors and the programmers are the same people, and hence there is no group of less experienced webmonkeys who need the protection of a sandboxed language (a language, incidentally, which is in some respects more intricate and harder to learn, while being less capable, than an uncrippled language like Python); and the cost of having to write a tag whenever you want to do almost anything besides interpolate just became silly.  So we&#8217;re using mako, even with reusable apps from other sources (this is quite possible, via our django-smorgasbord app), and although mako syntax is in some respects less pretty than django&#8217;s, it has been a big hit.  </p>
<p>I should stress this: Mark, you say that if you are using django you absolutely should use django templates &#8212; but in my experience there has been no penalty to swapping them out with mako &#8212; zero.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323170</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 11 Dec 2009 03:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323170</guid>
		<description>I too like the salt analogy, and I think this development cycle for Django is proving why that works.  Django&#039;s template engine basically started as the least logic humanly possible to do design.  However, this release of Django adds a more expressive syntax to the {% if %} tag, which is turns out is really handy for design logic.  I do however prefer the approach of using templatetags for anything more complicated than this.  You and James both pointed out they are *way* too hard to write, but I think that&#039;s being addressed by projects like templatetag-sugar (mine), tagcon, or surlex.</description>
		<content:encoded><![CDATA[<p>I too like the salt analogy, and I think this development cycle for Django is proving why that works.  Django&#8217;s template engine basically started as the least logic humanly possible to do design.  However, this release of Django adds a more expressive syntax to the {% if %} tag, which is turns out is really handy for design logic.  I do however prefer the approach of using templatetags for anything more complicated than this.  You and James both pointed out they are *way* too hard to write, but I think that&#8217;s being addressed by projects like templatetag-sugar (mine), tagcon, or surlex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Swirly</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323169</link>
		<dc:creator>Tom Swirly</dc:creator>
		<pubDate>Fri, 11 Dec 2009 01:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323169</guid>
		<description>What about Clearsilver?  I used it successfully for a templating project at my last job and it worked very well with Python...</description>
		<content:encoded><![CDATA[<p>What about Clearsilver?  I used it successfully for a templating project at my last job and it worked very well with Python&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kpd</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323168</link>
		<dc:creator>kpd</dc:creator>
		<pubDate>Thu, 10 Dec 2009 15:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323168</guid>
		<description>I don&#039;t have enough practical experience with Django
templates to add anything meaningful to the conversation.

My experience is with Cheetah, which I tend to hook into the framework early on.  The Django work I&#039;ve done ends up being mostly Cheetah with some Django templates in place where it&#039;s easier.  Unfortunately I&#039;m not dealing with designers writing pages.

I did want to say it was a great article, and I look forward to the rest of your series.  Thanks.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t have enough practical experience with Django<br />
templates to add anything meaningful to the conversation.</p>
<p>My experience is with Cheetah, which I tend to hook into the framework early on.  The Django work I&#8217;ve done ends up being mostly Cheetah with some Django templates in place where it&#8217;s easier.  Unfortunately I&#8217;m not dealing with designers writing pages.</p>
<p>I did want to say it was a great article, and I look forward to the rest of your series.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Bennett</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323167</link>
		<dc:creator>James Bennett</dc:creator>
		<pubDate>Wed, 09 Dec 2009 20:51:44 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323167</guid>
		<description>Mark, for me at least it&#039;s a theory of wanting to start with the simplest (i.e., least amount of logic) that could work for a significant number of people, then selectively adding more &quot;salt&quot; as good use cases come up. Which, really, is how Django&#039;s template language has been evolving; quite a few of the most useful tags were added around the 1.0 push, when we had a good solid base out there to understand what people were really missing.</description>
		<content:encoded><![CDATA[<p>Mark, for me at least it&#8217;s a theory of wanting to start with the simplest (i.e., least amount of logic) that could work for a significant number of people, then selectively adding more &#8220;salt&#8221; as good use cases come up. Which, really, is how Django&#8217;s template language has been evolving; quite a few of the most useful tags were added around the 1.0 push, when we had a good solid base out there to understand what people were really missing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Ramm</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323164</link>
		<dc:creator>Mark Ramm</dc:creator>
		<pubDate>Wed, 09 Dec 2009 16:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323164</guid>
		<description>James, 

I love the salt analogy.   

But the thing with template languages is that features aren&#039;t &quot;baked in&quot; until you use them.   Jingja, Genshi, and Mako all *allow* you to add lots and lots of salt to your templates, to the point where they are absolutely unusable by designers.   But they don&#039;t *require* you to add salt. 

Meanwhile Django Templates require you to jump through hoops if you want even a little bit of extra salt. 

That said, there are people who *should* have the salt taken away from them.   I had a college roommate who put 1/2 cup of vanilla in some ground beef that he was planning to turn into lasagna.  After that we wouldn&#039;t let him near the spice drawer... ;)</description>
		<content:encoded><![CDATA[<p>James, </p>
<p>I love the salt analogy.   </p>
<p>But the thing with template languages is that features aren&#8217;t &#8220;baked in&#8221; until you use them.   Jingja, Genshi, and Mako all *allow* you to add lots and lots of salt to your templates, to the point where they are absolutely unusable by designers.   But they don&#8217;t *require* you to add salt. </p>
<p>Meanwhile Django Templates require you to jump through hoops if you want even a little bit of extra salt. </p>
<p>That said, there are people who *should* have the salt taken away from them.   I had a college roommate who put 1/2 cup of vanilla in some ground beef that he was planning to turn into lasagna.  After that we wouldn&#8217;t let him near the spice drawer&#8230; ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323162</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Wed, 09 Dec 2009 14:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323162</guid>
		<description>Would it be hard to change the code to support early failure better? 

From what I have read it looks like a (somewhat) minor fix, but for some developers it would be a great gain.</description>
		<content:encoded><![CDATA[<p>Would it be hard to change the code to support early failure better? </p>
<p>From what I have read it looks like a (somewhat) minor fix, but for some developers it would be a great gain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antoine</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323159</link>
		<dc:creator>Antoine</dc:creator>
		<pubDate>Wed, 09 Dec 2009 10:41:09 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323159</guid>
		<description>I guess the advent of cheesy download sites means Linux has become a true mainstream platform :)</description>
		<content:encoded><![CDATA[<p>I guess the advent of cheesy download sites means Linux has become a true mainstream platform :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Bennett</title>
		<link>http://compoundthinking.com/blog/index.php/2009/12/09/python-template-languages-part-1-django/#comment-323158</link>
		<dc:creator>James Bennett</dc:creator>
		<pubDate>Wed, 09 Dec 2009 10:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/?p=273#comment-323158</guid>
		<description>Generally I do think custom tags are the answer for more complex presentational logic (and a few other things as well). But you&#039;re right in that writing them sucks. Part of it is just the way the template system works -- first you parse (and so have to tell the system how to parse your tag) and then you render (and so have to tell it how to render). And I&#039;d dearly love to get proper namespaces in there at some point.

But I also think we&#039;ve failed pretty hard on that area of the documentation, because there are some fairly powerful patterns that crop up in real-world applications, but which aren&#039;t mentioned at all in the docs (sometime have a look at the tags in contrib.comments for an example -- they lets you write an awful lot of custom functionality with very little code). One of these days when I have free time again I&#039;ll see what I can do to expand the coverage and make it a bit more approachable, since overall it&#039;s really not that hard, just something we really don&#039;t help people understand right now.

As for logic in templates, well, I do tend to agree with Jacob (http://jacobian.org/writing/salt/) -- I&#039;d rather add a bit of salt now and again than have to worry about too much already being baked in :)</description>
		<content:encoded><![CDATA[<p>Generally I do think custom tags are the answer for more complex presentational logic (and a few other things as well). But you&#8217;re right in that writing them sucks. Part of it is just the way the template system works &#8212; first you parse (and so have to tell the system how to parse your tag) and then you render (and so have to tell it how to render). And I&#8217;d dearly love to get proper namespaces in there at some point.</p>
<p>But I also think we&#8217;ve failed pretty hard on that area of the documentation, because there are some fairly powerful patterns that crop up in real-world applications, but which aren&#8217;t mentioned at all in the docs (sometime have a look at the tags in contrib.comments for an example &#8212; they lets you write an awful lot of custom functionality with very little code). One of these days when I have free time again I&#8217;ll see what I can do to expand the coverage and make it a bit more approachable, since overall it&#8217;s really not that hard, just something we really don&#8217;t help people understand right now.</p>
<p>As for logic in templates, well, I do tend to agree with Jacob (<a href="http://jacobian.org/writing/salt/" rel="nofollow">http://jacobian.org/writing/salt/</a>) &#8212; I&#8217;d rather add a bit of salt now and again than have to worry about too much already being baked in :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

