<?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"
	>
<channel>
	<title>Comments for Important Shock</title>
	<atom:link href="http://importantshock.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://importantshock.wordpress.com</link>
	<description>Because life's too short to use Perl.</description>
	<pubDate>Sat, 19 Jul 2008 00:34:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>Comment on Worse is Better: Python templating systems vs. Rails ERb by Sam</title>
		<link>http://importantshock.wordpress.com/2006/12/03/worse-is-better-python-templating-systems-vs-rails-erb/#comment-5478</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Mon, 07 Jul 2008 23:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2006/12/03/worse-is-better-python-templating-systems-vs-rails-erb/#comment-5478</guid>
		<description>I have always found the line between "business logic" and "template logic" hard to define but I am quite sure the way to separate these concerns has nothing to do with the power of the template language. Instead, I believe in the following rule: templates are pure functions. A template is not allowed to modify the callers environment, nor is its output dependant on any state not explicitly passed to it. Its sole purpose is to transform input to output and it can use any algorithm or language to do so as long as the template remains referentially transparent. This gets a bit fuzzy with 'magic' since @post.author.name may or may not need a database query depending on whether the :include directive was used in the controller e.g. @post = Post.find ... :include =&#62; :author. Whether or not you consider a second database read referentially transparent depends on the application but since it is not atomic with the first it is always possible that the author's name was changed between controller and template execution. In summary, db reads in the template are bad but Rails encourages them during development. When the app settles into a more final form it is best to add the :include directive in the controller for atomic reads and performance. Templates as pure functions is a pretty easy rule to enforce. Easy enough that there is no reason to limit the template language, and as a bonus pure functions have a good definition unlike the silly idea of "business logic". What's that anyway?


Blogged about it.
http://samdanielson.com/2007/9/11/templates-are-pure-functions</description>
		<content:encoded><![CDATA[<p>I have always found the line between &#8220;business logic&#8221; and &#8220;template logic&#8221; hard to define but I am quite sure the way to separate these concerns has nothing to do with the power of the template language. Instead, I believe in the following rule: templates are pure functions. A template is not allowed to modify the callers environment, nor is its output dependant on any state not explicitly passed to it. Its sole purpose is to transform input to output and it can use any algorithm or language to do so as long as the template remains referentially transparent. This gets a bit fuzzy with &#8216;magic&#8217; since @post.author.name may or may not need a database query depending on whether the :include directive was used in the controller e.g. @post = Post.find &#8230; :include =&gt; :author. Whether or not you consider a second database read referentially transparent depends on the application but since it is not atomic with the first it is always possible that the author&#8217;s name was changed between controller and template execution. In summary, db reads in the template are bad but Rails encourages them during development. When the app settles into a more final form it is best to add the :include directive in the controller for atomic reads and performance. Templates as pure functions is a pretty easy rule to enforce. Easy enough that there is no reason to limit the template language, and as a bonus pure functions have a good definition unlike the silly idea of &#8220;business logic&#8221;. What&#8217;s that anyway?</p>
<p>Blogged about it.<br />
<a href="http://samdanielson.com/2007/9/11/templates-are-pure-functions" rel="nofollow">http://samdanielson.com/2007/9/11/templates-are-pure-functions</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on C == Assembly by cr0</title>
		<link>http://importantshock.wordpress.com/2007/03/04/c-assembly/#comment-5477</link>
		<dc:creator>cr0</dc:creator>
		<pubDate>Tue, 01 Jul 2008 23:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2007/03/04/c-assembly/#comment-5477</guid>
		<description>i cant stand c its just full of random bullshit that has nothing to to with your program like other hlls.</description>
		<content:encoded><![CDATA[<p>i cant stand c its just full of random bullshit that has nothing to to with your program like other hlls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 15 Programming Exercises by rascunho &#187; Blog Archive &#187; links for 2008-06-30</title>
		<link>http://importantshock.wordpress.com/2007/11/11/15-programming-exercises/#comment-5476</link>
		<dc:creator>rascunho &#187; Blog Archive &#187; links for 2008-06-30</dc:creator>
		<pubDate>Mon, 30 Jun 2008 20:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2007/11/11/15-programming-exercises/#comment-5476</guid>
		<description>[...] 15 Programming Exercises « Important Shock As such, I present to you a list of programming challenges. (tags: importantshock.wordpress.com 2008 mes5 dia30 at_tecp programming tests Python code_kata ***** ruby tutorial) [...]</description>
		<content:encoded><![CDATA[<p>[...] 15 Programming Exercises « Important Shock As such, I present to you a list of programming challenges. (tags: importantshock.wordpress.com 2008 mes5 dia30 at_tecp programming tests Python code_kata ***** ruby tutorial) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on One-line factorial function in Python by Jameson</title>
		<link>http://importantshock.wordpress.com/2006/11/03/one-line-factorial-function-in-python/#comment-5474</link>
		<dc:creator>Jameson</dc:creator>
		<pubDate>Thu, 26 Jun 2008 07:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2006/11/03/one-line-factorial-function-in-python/#comment-5474</guid>
		<description>python needs a carriage returns followed by an indentation after defining a function... do it like this:

&lt;cite&gt;
&#62;&#62;&#62; def fact(x):
...     return (1 if x==0 else x * fact(x-1))
... 
&#62;&#62;&#62; fact(1)
1
&#62;&#62;&#62; fact(10)
3628800
&lt;/cite&gt;</description>
		<content:encoded><![CDATA[<p>python needs a carriage returns followed by an indentation after defining a function&#8230; do it like this:</p>
<p><cite><br />
&gt;&gt;&gt; def fact(x):<br />
&#8230;     return (1 if x==0 else x * fact(x-1))<br />
&#8230;<br />
&gt;&gt;&gt; fact(1)<br />
1<br />
&gt;&gt;&gt; fact(10)<br />
3628800<br />
</cite></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on One-line factorial function in Python by Michael Hartley</title>
		<link>http://importantshock.wordpress.com/2006/11/03/one-line-factorial-function-in-python/#comment-5473</link>
		<dc:creator>Michael Hartley</dc:creator>
		<pubDate>Wed, 25 Jun 2008 07:23:29 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2006/11/03/one-line-factorial-function-in-python/#comment-5473</guid>
		<description>err.. pardon my ignorance of large non-venomous snakes, but how do I actually use this? Here's what happened when I tried :

&lt;code&gt;[mikeh@pud21 ~]$ python
Python 2.4.3 (#1, Mar 14 2007, 19:01:42) 
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&#62;&#62;&#62; def fact(x): return (1 if x==0 else x * fact(x-1))
  File "", line 1
    def fact(x): return (1 if x==0 else x * fact(x-1))
                            ^
SyntaxError: invalid syntax
&#62;&#62;&#62; &lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>err.. pardon my ignorance of large non-venomous snakes, but how do I actually use this? Here&#8217;s what happened when I tried :</p>
<p><code>[mikeh@pud21 ~]$ python<br />
Python 2.4.3 (#1, Mar 14 2007, 19:01:42)<br />
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt; def fact(x): return (1 if x==0 else x * fact(x-1))<br />
  File &#8220;&#8221;, line 1<br />
    def fact(x): return (1 if x==0 else x * fact(x-1))<br />
                            ^<br />
SyntaxError: invalid syntax<br />
&gt;&gt;&gt; </code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on About by Benson Miller</title>
		<link>http://importantshock.wordpress.com/about/#comment-5471</link>
		<dc:creator>Benson Miller</dc:creator>
		<pubDate>Wed, 18 Jun 2008 00:18:55 +0000</pubDate>
		<guid isPermaLink="false">#comment-5471</guid>
		<description>Nice blog. Found you through Brandon Werner's FoaF document. Consider yourself subscribed.</description>
		<content:encoded><![CDATA[<p>Nice blog. Found you through Brandon Werner&#8217;s FoaF document. Consider yourself subscribed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Whither High School Computer Science? by Albina-ro</title>
		<link>http://importantshock.wordpress.com/2007/05/11/whither-high-school-computer-science/#comment-5468</link>
		<dc:creator>Albina-ro</dc:creator>
		<pubDate>Fri, 06 Jun 2008 18:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2007/05/11/whither-high-school-computer-science/#comment-5468</guid>
		<description>&lt;a&gt;&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on One-line factorial function in Python by Aditya</title>
		<link>http://importantshock.wordpress.com/2006/11/03/one-line-factorial-function-in-python/#comment-5467</link>
		<dc:creator>Aditya</dc:creator>
		<pubDate>Tue, 03 Jun 2008 06:44:06 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2006/11/03/one-line-factorial-function-in-python/#comment-5467</guid>
		<description>Thanks for the information Peter, but can't you just give the command 'time' while calculating the factorial? I mean, give the command,

time python programName.py

it will output the time. Built-in time function for all *nix systems.</description>
		<content:encoded><![CDATA[<p>Thanks for the information Peter, but can&#8217;t you just give the command &#8216;time&#8217; while calculating the factorial? I mean, give the command,</p>
<p>time python programName.py</p>
<p>it will output the time. Built-in time function for all *nix systems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Compensating for the Suckage of OS X Terminals by k</title>
		<link>http://importantshock.wordpress.com/2007/09/12/compensating-for-the-suckage-of-os-x-terminals/#comment-5466</link>
		<dc:creator>k</dc:creator>
		<pubDate>Fri, 30 May 2008 16:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2007/09/12/compensating-for-the-suckage-of-os-x-terminals/#comment-5466</guid>
		<description>This still doesn't solve the problem for those users where the keyboard requires Option to make the following symbols:
&#124; ] [ \ { } 
..all of which are used constantly in programming. 

Why Terminal.app doesn't let you "use command as meta" is completely beyond me, and possibly the only major reason why I'm still not a real mac-fan.</description>
		<content:encoded><![CDATA[<p>This still doesn&#8217;t solve the problem for those users where the keyboard requires Option to make the following symbols:<br />
| ] [ \ { }<br />
..all of which are used constantly in programming. </p>
<p>Why Terminal.app doesn&#8217;t let you &#8220;use command as meta&#8221; is completely beyond me, and possibly the only major reason why I&#8217;m still not a real mac-fan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 15 Programming Exercises by Pbur&#8217;s Adventures &#187; Blog Archive &#187; links for 2008-05-14</title>
		<link>http://importantshock.wordpress.com/2007/11/11/15-programming-exercises/#comment-5464</link>
		<dc:creator>Pbur&#8217;s Adventures &#187; Blog Archive &#187; links for 2008-05-14</dc:creator>
		<pubDate>Wed, 14 May 2008 04:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://importantshock.wordpress.com/2007/11/11/15-programming-exercises/#comment-5464</guid>
		<description>[...] 15 Programming Exercises (tags: programming language exercise)      Leave a Comment [...]</description>
		<content:encoded><![CDATA[<p>[...] 15 Programming Exercises (tags: programming language exercise)      Leave a Comment [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
