<?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: Perl vs. Python vs. Ruby</title>
	<atom:link href="http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/</link>
	<description></description>
	<lastBuildDate>Thu, 18 Mar 2010 20:01:44 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: anonymous</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-539816</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Fri, 12 Mar 2010 15:17:19 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-539816</guid>
		<description>Jon:
&quot;Why in the WORLD did someone come up with the idea in the late 1980s that there had to be TWO sets of comparison operators, one for numbers and one for strings?&quot;

Perl can&#039;t do all the work for you.  If you want it to decide according to context whether &quot;4.5&quot; is a string or a number, you have to provide a context.  I don&#039;t know about you, but I&#039;d rather juggle two sets of operators than have to convert my numberish strings to numbers explicitly.</description>
		<content:encoded><![CDATA[<p>Jon:<br />
"Why in the WORLD did someone come up with the idea in the late 1980s that there had to be TWO sets of comparison operators, one for numbers and one for strings?"</p>
<p>Perl can't do all the work for you.  If you want it to decide according to context whether "4.5" is a string or a number, you have to provide a context.  I don't know about you, but I'd rather juggle two sets of operators than have to convert my numberish strings to numbers explicitly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tbartdev</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-539693</link>
		<dc:creator>tbartdev</dc:creator>
		<pubDate>Wed, 10 Mar 2010 14:04:04 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-539693</guid>
		<description>I know this is OT, but seriously, gentlemen, IF you want to use console &amp; friends, then please do so responsiby ;-&gt;

I say forget grep, awk and whatnot. sed has it all, if you can be sure the input is in a fixed format.

This is what you need:
wget -O - http://www.mjtsai.com/blog/files/2002-11-25-sample-input.txt 2&gt;/dev/null &#124; sed -ne &#039;/\(&quot;[^&quot;]*&quot;\t\)\{26\}&quot;1&quot;/s#\(&quot;[^&quot;]*&quot;\t\)\{17\}&quot;\([^&quot;]*\)&quot;.*$#\2#p&#039;

and I guess this is also as fast as you can get...</description>
		<content:encoded><![CDATA[<p>I know this is OT, but seriously, gentlemen, IF you want to use console &amp; friends, then please do so responsiby ;-&gt;</p>
<p>I say forget grep, awk and whatnot. sed has it all, if you can be sure the input is in a fixed format.</p>
<p>This is what you need:<br />
wget -O - <a href="http://www.mjtsai.com/blog/files/2002-11-25-sample-input.txt" rel="nofollow">http://www.mjtsai.com/blog/files/2002-11-25-sample-input.txt</a> 2&gt;/dev/null | sed -ne '/\("[^"]*"\t\)\{26\}"1"/s#\("[^"]*"\t\)\{17\}"\([^"]*\)".*$#\2#p'</p>
<p>and I guess this is also as fast as you can get...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palash</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-537801</link>
		<dc:creator>palash</dc:creator>
		<pubDate>Fri, 12 Feb 2010 20:51:27 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-537801</guid>
		<description>Really an interesting discussion. Michel started with perl but settled (happy with python). Readability is definitely a point which assists a programmer or even a non programmer who wants to learn and improve the code but doesnt have the technical competence in that language. Perhaps in that sense python scores better. The &gt;&gt;&gt; interface of python is where we can check the code. Ok, now a different set of problem. Suppose we have to automate the server configuration process. Say we have to modify /etc/inittab and change it to init 3. In such case which can score better? Perl, Python or Ruby .... Shell Script like old unix guy says...?</description>
		<content:encoded><![CDATA[<p>Really an interesting discussion. Michel started with perl but settled (happy with python). Readability is definitely a point which assists a programmer or even a non programmer who wants to learn and improve the code but doesnt have the technical competence in that language. Perhaps in that sense python scores better. The &gt;&gt;&gt; interface of python is where we can check the code. Ok, now a different set of problem. Suppose we have to automate the server configuration process. Say we have to modify /etc/inittab and change it to init 3. In such case which can score better? Perl, Python or Ruby .... Shell Script like old unix guy says...?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John P</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-536266</link>
		<dc:creator>John P</dc:creator>
		<pubDate>Fri, 22 Jan 2010 22:36:45 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-536266</guid>
		<description>I started with Perl, then learned some Java and C/C++.  Surrounded by many Pythonistas, I fully intended to make the jump to Python, but it felt awkward to me.  Later I tried Ruby and very quickly fell in love.  I&#039;d been writing Perl for many years, but I found I could accomplish the same tasks in much cleaner ways with far fewer mistakes coding in Ruby.  I&#039;ve had to use Python (matplotlib and pymol scripting in particular) for some projects since then; it is a great language with fantastic libraries.  Ruby and Python are far more similar than they are different.  For me, Ruby, despite her few warts, flows in a way that I haven&#039;t been able to duplicate in Python.  I guess I&#039;d rather write my own library/extension in/for Ruby (which one has to do less frequently these days) than use an existing solution in Python or Perl.  I do think the crosstalk between the languages is a good thing and appreciate all the great code that comes out of each camp.  Interesting blog and comments.</description>
		<content:encoded><![CDATA[<p>I started with Perl, then learned some Java and C/C++.  Surrounded by many Pythonistas, I fully intended to make the jump to Python, but it felt awkward to me.  Later I tried Ruby and very quickly fell in love.  I'd been writing Perl for many years, but I found I could accomplish the same tasks in much cleaner ways with far fewer mistakes coding in Ruby.  I've had to use Python (matplotlib and pymol scripting in particular) for some projects since then; it is a great language with fantastic libraries.  Ruby and Python are far more similar than they are different.  For me, Ruby, despite her few warts, flows in a way that I haven't been able to duplicate in Python.  I guess I'd rather write my own library/extension in/for Ruby (which one has to do less frequently these days) than use an existing solution in Python or Perl.  I do think the crosstalk between the languages is a good thing and appreciate all the great code that comes out of each camp.  Interesting blog and comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David M</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-533271</link>
		<dc:creator>David M</dc:creator>
		<pubDate>Tue, 22 Dec 2009 04:21:22 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-533271</guid>
		<description>Great stuff all around.  I am a Perl guy and just wanted to add my notes and clarify a few points, especially about the 200-line &#039;mental limit&#039; for Perl scripts.

I have read Eric Raymond&#039;s discussion on why he prefers Python.  I think he has good points, but he wrote those comments in 2000.  The Perl community has come a long way.  The best rejoinder is probably Perl Best Practices, by Damian Conway.  But always remember: You can write fortran in any language.  :)

As for scalability of perl scripts, I have heard that Perl programs get quite difficult to maintain after they get much larger than about 100 lines.  I agree with that - maintaining a sense of context becomes mind-bending.  My rule of thumb is that if my script gets much longer than 200 lines, it probably has some ideas that I can (and should) abstract into modules.

I recently ran into this very problem with a really simple simulator for my research.  The program reached maybe 500 or 600 lines before I finally refactored it into many modules.  Now I am back to writing 15 line scripts using my newly created libraries.  It was painful but very enlightening to refactor and now I have an extensible (extendable) library that I can use for my research that should carry me through my thesis and quite possibly beyond.

By the way, you might think that my collection of modules should have the same 200-line mental limitations, but I find that I can work with a module with many thousands of lines of code and it doesn&#039;t bother me.  This is because the modules tends to focus on a much more clearly defined target, which makes the context much narrower.  Also, I tend to be much stricter with my libraries than with my scripts, especially when it comes to documentation.

Is this 200+ line mental limit on Perl scripts a feature or a bug?  Obviously it depends on what you&#039;re trying to do, but for me, it has turned out to be a great feature.


P.S. Just to be sure everybody is clear: Perl can do serious computational stuff, at the computational level of C/Fortran.  It&#039;s called PDL.  I do all sorts of numerical stuff with PDL as grad student in physics, doing (single-core) simulations at the moment.  I linked to PDL&#039;s web page, and while it looks old, the modules are still in active maintenance and development.  And mailing list is awfully nice, too!</description>
		<content:encoded><![CDATA[<p>Great stuff all around.  I am a Perl guy and just wanted to add my notes and clarify a few points, especially about the 200-line 'mental limit' for Perl scripts.</p>
<p>I have read Eric Raymond's discussion on why he prefers Python.  I think he has good points, but he wrote those comments in 2000.  The Perl community has come a long way.  The best rejoinder is probably Perl Best Practices, by Damian Conway.  But always remember: You can write fortran in any language.  :)</p>
<p>As for scalability of perl scripts, I have heard that Perl programs get quite difficult to maintain after they get much larger than about 100 lines.  I agree with that - maintaining a sense of context becomes mind-bending.  My rule of thumb is that if my script gets much longer than 200 lines, it probably has some ideas that I can (and should) abstract into modules.</p>
<p>I recently ran into this very problem with a really simple simulator for my research.  The program reached maybe 500 or 600 lines before I finally refactored it into many modules.  Now I am back to writing 15 line scripts using my newly created libraries.  It was painful but very enlightening to refactor and now I have an extensible (extendable) library that I can use for my research that should carry me through my thesis and quite possibly beyond.</p>
<p>By the way, you might think that my collection of modules should have the same 200-line mental limitations, but I find that I can work with a module with many thousands of lines of code and it doesn't bother me.  This is because the modules tends to focus on a much more clearly defined target, which makes the context much narrower.  Also, I tend to be much stricter with my libraries than with my scripts, especially when it comes to documentation.</p>
<p>Is this 200+ line mental limit on Perl scripts a feature or a bug?  Obviously it depends on what you're trying to do, but for me, it has turned out to be a great feature.</p>
<p>P.S. Just to be sure everybody is clear: Perl can do serious computational stuff, at the computational level of C/Fortran.  It's called PDL.  I do all sorts of numerical stuff with PDL as grad student in physics, doing (single-core) simulations at the moment.  I linked to PDL's web page, and while it looks old, the modules are still in active maintenance and development.  And mailing list is awfully nice, too!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-532447</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Fri, 11 Dec 2009 19:11:36 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-532447</guid>
		<description>John said that REXX is no longer relevant.  I am not sure that is true :-)  REXX continues to be distributed with IBM systems and there has been an ANSI standard for REXX since 1996.  There are a number of open source REXX&#039;s available including several object-oriented REXX&#039;s.  All are good implementations.

I used REXX for a long time, but use Python almost exclusively now.  I never liked Perl.  Why in the WORLD did someone come up with the idea in the late 1980s that there had to be TWO sets of comparison operators, one for numbers and one for strings?  That looks like SUCH a &quot;lazy compiler/interpreter writer&quot; thing that one has to ask WTF?  I mean even lowly BASIC didn&#039;t need that kludge.  The first time I encountered that, I pretty much figured that Perl was a poorly designed language hack, even if it did make some things &quot;easy to do&quot;.

Read Eric Raymond&#039;s 2000 article on Why Python? to get from someone who loved Perl and is well respected in the industry as a user of programming languages why Python is definitively a &quot;better language&quot;.

BTW, I write/have written in MANY languages over the years, including like John, in ALC for the 370, Cobol, PL/I, C, C++, Objective-C (before it was used on the Mac :-), Java, REXX, Python, Ruby, SQL, etc.  There are many languages, and there is no one &quot;perfect&quot; language.  The good languages each have a problem domain (or several) that they are best suited for.  

However, there are &quot;poor&quot; languages, languages that make things difficult or obscure or are just poorly designed.  At the risk of LOTS of flames, I consider Perl to be one of these, ditto for PHP.  This obviously ignores the fact that both are used by MANY MANY people, but that doesn&#039;t make them &quot;better&quot; by any means.  Acceptance is as much an accident of history as it is a matter of goodness.  Python, Perl and indeed PHP have many similar problem domains, and there is no question, that if I am in one of those domains, I prefer Python every time.

Jon
-------------------------------
&quot;The difference between theory and reality is that in theory, there is no difference, but in reality, there is.&quot;</description>
		<content:encoded><![CDATA[<p>John said that REXX is no longer relevant.  I am not sure that is true :-)  REXX continues to be distributed with IBM systems and there has been an ANSI standard for REXX since 1996.  There are a number of open source REXX's available including several object-oriented REXX's.  All are good implementations.</p>
<p>I used REXX for a long time, but use Python almost exclusively now.  I never liked Perl.  Why in the WORLD did someone come up with the idea in the late 1980s that there had to be TWO sets of comparison operators, one for numbers and one for strings?  That looks like SUCH a "lazy compiler/interpreter writer" thing that one has to ask WTF?  I mean even lowly BASIC didn't need that kludge.  The first time I encountered that, I pretty much figured that Perl was a poorly designed language hack, even if it did make some things "easy to do".</p>
<p>Read Eric Raymond's 2000 article on Why Python? to get from someone who loved Perl and is well respected in the industry as a user of programming languages why Python is definitively a "better language".</p>
<p>BTW, I write/have written in MANY languages over the years, including like John, in ALC for the 370, Cobol, PL/I, C, C++, Objective-C (before it was used on the Mac :-), Java, REXX, Python, Ruby, SQL, etc.  There are many languages, and there is no one "perfect" language.  The good languages each have a problem domain (or several) that they are best suited for.  </p>
<p>However, there are "poor" languages, languages that make things difficult or obscure or are just poorly designed.  At the risk of LOTS of flames, I consider Perl to be one of these, ditto for PHP.  This obviously ignores the fact that both are used by MANY MANY people, but that doesn't make them "better" by any means.  Acceptance is as much an accident of history as it is a matter of goodness.  Python, Perl and indeed PHP have many similar problem domains, and there is no question, that if I am in one of those domains, I prefer Python every time.</p>
<p>Jon<br />
-------------------------------<br />
"The difference between theory and reality is that in theory, there is no difference, but in reality, there is."</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zen sand gardens</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-530469</link>
		<dc:creator>zen sand gardens</dc:creator>
		<pubDate>Wed, 18 Nov 2009 21:02:51 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-530469</guid>
		<description>Wow, nice article. I like Python better than Ruby better than Perl. I simply like expressive, clean languages.</description>
		<content:encoded><![CDATA[<p>Wow, nice article. I like Python better than Ruby better than Perl. I simply like expressive, clean languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-530092</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 13 Nov 2009 23:22:02 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-530092</guid>
		<description>Awesome thread.  I have been in management a long time but LOVE programming.  I was a mainframe ALC/COBOL programmer for years before venturing into JAVA/C++ a little then was &quot;promoted&quot; (lol) to management.  I miss programming.

The reason I found this is that I was asked to help with something in my company which may require file/text manipulation for a conversion of data from one system to another.

I was very proficient with REXX (if anyone knows that that is) which I loved.  Seeing that it&#039;s no longer relevant I did a search on interpretive languages for file/text manipulation and eventually found this thread. 

Many thanks to the person who started this topic and to EVERYONE for all the replies.  As a result, I will go with Perl (I dabbled in it a LONG time ago) and will play with the others for fun.</description>
		<content:encoded><![CDATA[<p>Awesome thread.  I have been in management a long time but LOVE programming.  I was a mainframe ALC/COBOL programmer for years before venturing into JAVA/C++ a little then was "promoted" (lol) to management.  I miss programming.</p>
<p>The reason I found this is that I was asked to help with something in my company which may require file/text manipulation for a conversion of data from one system to another.</p>
<p>I was very proficient with REXX (if anyone knows that that is) which I loved.  Seeing that it's no longer relevant I did a search on interpretive languages for file/text manipulation and eventually found this thread. </p>
<p>Many thanks to the person who started this topic and to EVERYONE for all the replies.  As a result, I will go with Perl (I dabbled in it a LONG time ago) and will play with the others for fun.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Albino</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-529584</link>
		<dc:creator>Albino</dc:creator>
		<pubDate>Sun, 08 Nov 2009 22:06:22 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-529584</guid>
		<description>Generators!  You must learn the power of generators in python.

Here is my preferred solution:
http://paste.lisp.org/display/90009

Also, read pep8, in python we eschew the use of camelCase.  Leave that to the Java peeps since they can&#039;t get enough widgetWhichProducesBSFactory.  I like that with mine it is more clear which field we are sorting and filtering on.</description>
		<content:encoded><![CDATA[<p>Generators!  You must learn the power of generators in python.</p>
<p>Here is my preferred solution:<br />
<a href="http://paste.lisp.org/display/90009" rel="nofollow">http://paste.lisp.org/display/90009</a></p>
<p>Also, read pep8, in python we eschew the use of camelCase.  Leave that to the Java peeps since they can't get enough widgetWhichProducesBSFactory.  I like that with mine it is more clear which field we are sorting and filtering on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://mjtsai.com/blog/2002/11/25/perl_vs_python_vs_ruby/comment-page-3/#comment-529429</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sat, 07 Nov 2009 15:31:14 +0000</pubDate>
		<guid isPermaLink="false">/?p=92#comment-529429</guid>
		<description>Edward C wrote:

&gt; Even though I only knew it for days, it feels, weirdly comforting and nice (ref. to the warm blanket above).

Yes. That right there I think is one of the keys to Perl&#039;s success. Larry and Company have gone through great pains -- years of polishing and fine tuning -- to get Perl to have that well-worn comfortable feel.

My hunch/hope is that they&#039;re doing/have-done the same thing with Perl 6, but I haven&#039;t learned Perl 6 yet.</description>
		<content:encoded><![CDATA[<p>Edward C wrote:</p>
<p>&gt; Even though I only knew it for days, it feels, weirdly comforting and nice (ref. to the warm blanket above).</p>
<p>Yes. That right there I think is one of the keys to Perl's success. Larry and Company have gone through great pains -- years of polishing and fine tuning -- to get Perl to have that well-worn comfortable feel.</p>
<p>My hunch/hope is that they're doing/have-done the same thing with Perl 6, but I haven't learned Perl 6 yet.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
