<?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: Why Reddit uses Python</title>
	<atom:link href="http://brainsik.theory.org/.:./2009/why-reddit-uses-python/feed" rel="self" type="application/rss+xml" />
	<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python</link>
	<description>.:. brainsik</description>
	<lastBuildDate>Thu, 18 Mar 2010 00:05:45 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Xiong Chiamiov</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-1692</link>
		<dc:creator>Xiong Chiamiov</dc:creator>
		<pubDate>Mon, 17 Aug 2009 16:03:21 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-1692</guid>
		<description>&lt;blockquote&gt;Tracking down bugs and figuring out what type of an object thing is supposed to be can be a nightmare.&lt;/blockquote&gt;

You&#039;re not _supposed_ to know (or care) what type something is.  What you have to keep track of is what you expect it to be able to do, and that only to a certain extent.

With &quot;easier to ask forgiveness than permission&quot; and duck typing such an integral part of the language, you&#039;re not going to be happy if you don&#039;t learn to love and use those.</description>
		<content:encoded><![CDATA[<blockquote><p>Tracking down bugs and figuring out what type of an object thing is supposed to be can be a nightmare.</p></blockquote>
<p>You&#8217;re not _supposed_ to know (or care) what type something is.  What you have to keep track of is what you expect it to be able to do, and that only to a certain extent.</p>
<p>With &#8220;easier to ask forgiveness than permission&#8221; and duck typing such an integral part of the language, you&#8217;re not going to be happy if you don&#8217;t learn to love and use those.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blick black</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-698</link>
		<dc:creator>blick black</dc:creator>
		<pubDate>Fri, 10 Apr 2009 19:02:56 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-698</guid>
		<description>As much as I like Python, its really a love/hate relationship.  My biggest problem with it is the lack of type definitions and the lack of structure.  Tracking down bugs and figuring out what type of an object thing is supposed to be can be a nightmare.  The fact that any object can have a new member added to it at anytime, isn&#039;t fun to track down.  Yes this all smells like bad coding styles to begin with, but when you have to modify someone elses code and figure out what is going on (mainly workin with alot of objects and classes) it can be a pain. 

Personally it would have been nice for python to allow for type declarations if the coder wanted to use them.  Code is much easier to scan and bugs much easier to track down.</description>
		<content:encoded><![CDATA[<p>As much as I like Python, its really a love/hate relationship.  My biggest problem with it is the lack of type definitions and the lack of structure.  Tracking down bugs and figuring out what type of an object thing is supposed to be can be a nightmare.  The fact that any object can have a new member added to it at anytime, isn&#8217;t fun to track down.  Yes this all smells like bad coding styles to begin with, but when you have to modify someone elses code and figure out what is going on (mainly workin with alot of objects and classes) it can be a pain. </p>
<p>Personally it would have been nice for python to allow for type declarations if the coder wanted to use them.  Code is much easier to scan and bugs much easier to track down.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-697</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Fri, 10 Apr 2009 16:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-697</guid>
		<description>&lt;blockquote&gt;And it’s awesome because I can see from across the room, looking at their screen, whether their code is good or bad. Because good Python code has a very obvious structure. And that makes my life so much easier.&lt;/blockquote&gt;

Your awesome code auditing methods explain why reddit has remained in a broken state for as long as I can remember.</description>
		<content:encoded><![CDATA[<blockquote><p>And it’s awesome because I can see from across the room, looking at their screen, whether their code is good or bad. Because good Python code has a very obvious structure. And that makes my life so much easier.</p></blockquote>
<p>Your awesome code auditing methods explain why reddit has remained in a broken state for as long as I can remember.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Gordon</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-696</link>
		<dc:creator>James Gordon</dc:creator>
		<pubDate>Fri, 10 Apr 2009 00:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-696</guid>
		<description>&lt;blockquote&gt;&lt;pre&gt;
def get_pairs(list1, list2):
    assert len(list1) == len(list2)
    return ((list1[i], list2[i]) for i in enumerate(list1))
&lt;/pre&gt;&lt;/blockquote&gt;

WHY? WHY?

&lt;pre&gt;
def get_pairs(list1, list2):
    zip(list1, list2)
&lt;/pre&gt;

Python reads better because common collections are integrated directly into the language where they belong and because functions are first class.

If Java had that, I would not have minded the static typing one bit. C# is heading in a more sane direction in this respect. I nevertheless tolerate, even enjoy static Java at times because of the strict adherence to idioms by its programmers and the wonderful IDEs that it is blessed with, which make navigating, modifying and examining the code easy.

Java guys: Don&#039;t debate type inference and properties as if your language is the only programming language in the entire world and as if you have to figure all this out carefully, all by yourself. They have been implemented many times before and no one ever regretted them adopting them.

Or lets just get a decent IDE for Scala and forget about Java. Without a decent IDE, Scala&#039;s higher constructs don&#039;t mean much for productivity when the Java libraries are verbose and low level.</description>
		<content:encoded><![CDATA[<blockquote><pre>
def get_pairs(list1, list2):
    assert len(list1) == len(list2)
    return ((list1[i], list2[i]) for i in enumerate(list1))
</pre>
</blockquote>
<p>WHY? WHY?</p>
<pre>
def get_pairs(list1, list2):
    zip(list1, list2)
</pre>
<p>Python reads better because common collections are integrated directly into the language where they belong and because functions are first class.</p>
<p>If Java had that, I would not have minded the static typing one bit. C# is heading in a more sane direction in this respect. I nevertheless tolerate, even enjoy static Java at times because of the strict adherence to idioms by its programmers and the wonderful IDEs that it is blessed with, which make navigating, modifying and examining the code easy.</p>
<p>Java guys: Don&#8217;t debate type inference and properties as if your language is the only programming language in the entire world and as if you have to figure all this out carefully, all by yourself. They have been implemented many times before and no one ever regretted them adopting them.</p>
<p>Or lets just get a decent IDE for Scala and forget about Java. Without a decent IDE, Scala&#8217;s higher constructs don&#8217;t mean much for productivity when the Java libraries are verbose and low level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-695</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Thu, 09 Apr 2009 23:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-695</guid>
		<description>I also have experienced this &quot;code shrinkage&quot; piramida speaks of, although I find myself quite embarassed by it.  I honestly think that it is just proof that I am evolving as a programmer, and that my code is never perfect...darn!

In any event, I like Python because it allows one to propose quick solutions to computational Biology, Chemistry (et al) problems.  It is easy to integrate with MATLAB.  I once wrote an interface to MATLAB in 1 hour with Python.  It is very friendly to folks in the hard sciences.</description>
		<content:encoded><![CDATA[<p>I also have experienced this &#8220;code shrinkage&#8221; piramida speaks of, although I find myself quite embarassed by it.  I honestly think that it is just proof that I am evolving as a programmer, and that my code is never perfect&#8230;darn!</p>
<p>In any event, I like Python because it allows one to propose quick solutions to computational Biology, Chemistry (et al) problems.  It is easy to integrate with MATLAB.  I once wrote an interface to MATLAB in 1 hour with Python.  It is very friendly to folks in the hard sciences.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piramida</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-694</link>
		<dc:creator>piramida</dc:creator>
		<pubDate>Thu, 09 Apr 2009 18:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-694</guid>
		<description>It is really easy to see from comments who have and who have never tried writing python code :) I have done extensive coding in all of the languages mentioned here (bar Smalltalk) and I can say that I easily second the original opinion - in no other language can developer express his/her logic more clearly than in python.

It&#039;s also one of the rare languages where the more you think about / refactor your code the smaller *and* clearer it becomes - which is an inherent magic property of that language, it seems :)</description>
		<content:encoded><![CDATA[<p>It is really easy to see from comments who have and who have never tried writing python code <img src='http://brainsik.theory.org/.:./wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I have done extensive coding in all of the languages mentioned here (bar Smalltalk) and I can say that I easily second the original opinion &#8211; in no other language can developer express his/her logic more clearly than in python.</p>
<p>It&#8217;s also one of the rare languages where the more you think about / refactor your code the smaller *and* clearer it becomes &#8211; which is an inherent magic property of that language, it seems <img src='http://brainsik.theory.org/.:./wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff M.</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-693</link>
		<dc:creator>Jeff M.</dc:creator>
		<pubDate>Thu, 09 Apr 2009 16:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-693</guid>
		<description>Just as people sometimes think that brief == readable, many programmers also confuse readable == maintainable. None of these things are the same. And very often, getting one means losing another. Sometimes getting very high-performance, multi-threaded, or ... code requires sacrificing one or more of the above.

Also, it&#039;s silly to throw out trivial examples (like getPairs) where sometimes language syntax can be argued either way. I don&#039;t know Python. I can venture a guess as to what the get_pairs example code does above, but I wouldn&#039;t be sure. But it&#039;s _very_ clear what the Java code does (and I don&#039;t know Java either). Then again, what about any language with list comprehensions?

&lt;code&gt;[ {A, B} &#124;&#124; A &lt;- List0, B &lt;- List1 ]&lt;/code&gt;

Is that more readable because it&#039;s more terse? Show that to anyone who has never seen a list comprehension or doesn&#039;t know Erlang and I think you&#039;d have a hard time arguing that it&#039;s more readable. But it&#039;s certainly more maintainable (imo). Then again, how about showing a non-programmer some Qt UI code in Python vs. say... Hypercard:

&lt;code&gt;set the text of field &quot;Name&quot; to &quot;Jeff&quot;&lt;/code&gt;

That&#039;s a heluvalot more readable than the Python would be, but also more verbose. At the end of the day it. comes down to this simple fact:

Working code is good code.

Plain and simple. I know many of you will argue that. But you can spend forever iterating code trying to get it just right, and never actually ship anything. You can waste time debating whether to use Python or Lisp or C or Smalltalk, but that&#039;s just time you are wasting vs. getting the project to market. I&#039;ve seen very &quot;experienced&quot; programmers who couldn&#039;t actually complete anything they were so stuck in the details, and I&#039;ve seen novice programmers with BASIC turn out some pretty amazing things.</description>
		<content:encoded><![CDATA[<p>Just as people sometimes think that brief == readable, many programmers also confuse readable == maintainable. None of these things are the same. And very often, getting one means losing another. Sometimes getting very high-performance, multi-threaded, or &#8230; code requires sacrificing one or more of the above.</p>
<p>Also, it&#8217;s silly to throw out trivial examples (like getPairs) where sometimes language syntax can be argued either way. I don&#8217;t know Python. I can venture a guess as to what the get_pairs example code does above, but I wouldn&#8217;t be sure. But it&#8217;s _very_ clear what the Java code does (and I don&#8217;t know Java either). Then again, what about any language with list comprehensions?</p>
<p><code>[ {A, B} || A &lt;- List0, B &lt;- List1 ]</code></p>
<p>Is that more readable because it&#8217;s more terse? Show that to anyone who has never seen a list comprehension or doesn&#8217;t know Erlang and I think you&#8217;d have a hard time arguing that it&#8217;s more readable. But it&#8217;s certainly more maintainable (imo). Then again, how about showing a non-programmer some Qt UI code in Python vs. say&#8230; Hypercard:</p>
<p><code>set the text of field "Name" to "Jeff"</code></p>
<p>That&#8217;s a heluvalot more readable than the Python would be, but also more verbose. At the end of the day it. comes down to this simple fact:</p>
<p>Working code is good code.</p>
<p>Plain and simple. I know many of you will argue that. But you can spend forever iterating code trying to get it just right, and never actually ship anything. You can waste time debating whether to use Python or Lisp or C or Smalltalk, but that&#8217;s just time you are wasting vs. getting the project to market. I&#8217;ve seen very &#8220;experienced&#8221; programmers who couldn&#8217;t actually complete anything they were so stuck in the details, and I&#8217;ve seen novice programmers with BASIC turn out some pretty amazing things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dan</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-691</link>
		<dc:creator>dan</dc:creator>
		<pubDate>Thu, 09 Apr 2009 08:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-691</guid>
		<description>&lt;blockquote&gt;What you guys are saying is that Java and C# are more readable because of static typing right?&lt;/blockquote&gt;

No. They&#039;re saying shorter and more readable are not the same thing.</description>
		<content:encoded><![CDATA[<blockquote><p>What you guys are saying is that Java and C# are more readable because of static typing right?</p></blockquote>
<p>No. They&#8217;re saying shorter and more readable are not the same thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pixelmonkey</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-690</link>
		<dc:creator>pixelmonkey</dc:creator>
		<pubDate>Thu, 09 Apr 2009 04:59:43 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-690</guid>
		<description>&lt;blockquote&gt;it seems to actually be easier to read verbose code - it provides more structure and context to each statement/line&lt;/blockquote&gt;

Assume you have two equal length lists of integers (list1 and list2), and you want to create a list that contains the corresponding pairs of integers.

In Java:

&lt;pre&gt;
class Pair {
    int first;
    int second;
}

List getPairs(List list1, List list2) {

    assert list1.length == list2.length;

    List acc = new ArrayList();
    for (int i = 0; i &gt; list1.length; i++) {
        Pair pair = new Pair();
        pair.first = list1[i];
        pair.second = list2[i];
        acc.add(pair);
    }
    return acc;
}
&lt;/pre&gt;

Are you seriously going to argue that this is more readable than:

&lt;pre&gt;
def get_pairs(list1, list2):
    assert len(list1) == len(list2)
    return ((list1[i], list2[i]) for i in enumerate(list1))
&lt;/pre&gt;

Does the same thing, in Python.  We don&#039;t need &quot;Pair&quot; since tuple is a built-in type, but even if you discount the definition of &quot;Pair&quot;, you still are talking about 8 lines of imperative code versus one line of a very readable generator expression.  Not to mention that the Python single line is more scalable/performant than the Java version, due to the fact that get_pairs returns a generator rather than a fully-allocated list.  To write the equivalent in Java, I&#039;d have to implement an Iterator, and you don&#039;t even want to know how many lines of code that would take, and how many opportunities for errors there are!</description>
		<content:encoded><![CDATA[<blockquote><p>it seems to actually be easier to read verbose code &#8211; it provides more structure and context to each statement/line</p></blockquote>
<p>Assume you have two equal length lists of integers (list1 and list2), and you want to create a list that contains the corresponding pairs of integers.</p>
<p>In Java:</p>
<pre>
class Pair {
    int first;
    int second;
}

List getPairs(List list1, List list2) {

    assert list1.length == list2.length;

    List acc = new ArrayList();
    for (int i = 0; i &gt; list1.length; i++) {
        Pair pair = new Pair();
        pair.first = list1[i];
        pair.second = list2[i];
        acc.add(pair);
    }
    return acc;
}
</pre>
<p>Are you seriously going to argue that this is more readable than:</p>
<pre>
def get_pairs(list1, list2):
    assert len(list1) == len(list2)
    return ((list1[i], list2[i]) for i in enumerate(list1))
</pre>
<p>Does the same thing, in Python.  We don&#8217;t need &#8220;Pair&#8221; since tuple is a built-in type, but even if you discount the definition of &#8220;Pair&#8221;, you still are talking about 8 lines of imperative code versus one line of a very readable generator expression.  Not to mention that the Python single line is more scalable/performant than the Java version, due to the fact that get_pairs returns a generator rather than a fully-allocated list.  To write the equivalent in Java, I&#8217;d have to implement an Iterator, and you don&#8217;t even want to know how many lines of code that would take, and how many opportunities for errors there are!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [ mkhairul.com ] » Oh Python..</title>
		<link>http://brainsik.theory.org/.:./2009/why-reddit-uses-python/comment-page-1#comment-689</link>
		<dc:creator>[ mkhairul.com ] » Oh Python..</dc:creator>
		<pubDate>Thu, 09 Apr 2009 04:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://brainsik.theory.org/.:./?p=188#comment-689</guid>
		<description>[…] I read a post about Why Reddit Uses Python. I agree with Steve and that&#8217;s why I think Python will probably shine brighter in the […]</description>
		<content:encoded><![CDATA[<p>[…] I read a post about Why Reddit Uses Python. I agree with Steve and that&#8217;s why I think Python will probably shine brighter in the […]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
