Why did Quora choose Python for its development?

Octavian Rasnita orasnita at gmail.com
Sun May 22 03:44:18 EDT 2011


From: "Hansmeet Singh" <hansmeetschool at gmail.com>

>i think we should end our butchering of perl on a light note (you may have
> already read this):
> EXTERIOR: DAGOBAH -- DAY
> With Yoda strapped to his back, Luke climbs up one of
> the many thick vines that grow in the swamp until he
> reaches the Dagobah statistics lab. Panting heavily, he
> continues his exercises -- grepping, installing new
> packages, logging in as root, and writing replacements for
> two-year-old shell scripts in Python.
> 
> YODA: Code!  Yes.  A programmer's strength flows from code
>      maintainability.  But beware of Perl.  Terse syntax... more
>      than one way to do it...  default variables.  The dark side
>      of code maintainability are they.  Easily they flow, quick
>      to join you when code you write.  If once you start down the
>      dark path, forever will it dominate your destiny, consume
>      you it will.
> 
> LUKE: Is Perl better than Python?
> 
> YODA: No... no... no.  Quicker, easier, more seductive.
> 
> LUKE: But how will I know why Python is better than Perl?
> 
> YODA: You will know.  When your code you try to read six months
>      from now.
> 


I've noticed that on many Perl mailing lists the list members talk very rarely about Python, but only on this Python mailing list I read many discussions about Perl, in which most of the participants use to agree that yes, Python is better, as it shouldn't be obvious that most of the list members prefer Python.

If Python would be so great, you wouldn't talk so much about how bad are other languages, or if these discussions are not initiated by envy, you would be also talking about how bad is Visual Basic, or Pascal, or Delphi, or who knows other languages.

A few months ago I have asked how can I create a dictionary from a list, and there were so many techniques that I think that it is just a buzzword that in Perl there are many ways to do it, while in Python there is a single way. In Python I found from the messages I received on this mailing list that there are a lot of ways, without even beeing a "recommended" way, while in Perl there is a single way, of course much shorter and clearer.

A bad program can be written in any language, no matter if it is so strict and forces the programmer to use spaces as a way of defining the blocks of code, so the fact that Perl is very flexible is an advantage for the programmer who writes the code.

Perl offers the module Perl::Critic which offers a command line that checks the code for different levels of syntax errors which don't respect the good practices (which are also published in a book) so if the program has to be used by more programmers, it is very simple to bring it to a very standard syntax.

Perl also has Perl::Tidy that offers another command line which re-arrange the code to a standard way, including the indentation type, the placement of parenthesis, spacing and other things, so the programs can look visually the same.

And these are advantages for those that need to read the code by others also.

Because of its flexibility, Perl offers more advanced modules and libraries which are not available for Python. For example, Catalyst web framework is much powerful and flexible than any other Python framework, because it can be used with any ORM, with any templating system, with any form processor, with any type of configuration files (Apache style, ini, JSON, XML, perl data structures, yaml), and it can run with its own web server, or with mod_perl, FastCGI, cgi, psgi without any change, and it has a very clean and flexible URL dispatcher that doesn't need to do (and maintain) the URL mapping in a distinct module made only for this.
A Catalyst based application is very easy to maintain because it has a very clean structure and the command lines that can be used to automaticly generate the base for controllers, models or views also generate the base test files and also create a few basic tests for the created modules, beeing very easy to add new tests.

And DBIx::Class ORM is a very powerful ORM and Template-Toolkit a great templating system, and Moose can be used to create a very powerful object model, and there are a lot of other very good modules which are not available for other languages.

It can be hard to find the good quality Perl code while you don't know where to look for though. This is right, because the web is full of old-style Perl code since the era of Matt's Perl script archive, and the web is also full of pirated books about using CGI, but talking about that bad style code shows just that you are talking about something you don't know.

Somebody told that C# and Objective C are good languages. They might be good, but they are proprietary, and not only that they are proprietary, but they need to be ran under platforms that cannot be used freely, so from the freedom point of view, Perl, Ruby, Python and Java are the ways to go.

Octavian




More information about the Python-list mailing list