Wednesday, August 20, 2008

Perl Vs Python Fight

I was confused as to what to start with? Perl or Python. Though I had done Perl before but wanna give a chance to Python too, if it outperforms Perl. I browsed through the web, and compiled the following pros and cons for both of them:

1) Python tends to focus more on code aesthetics than performance; as a result, Python OpenGL developers continue to struggle with overcoming Python's array handling performance issues.

2) Perl is much simpler to port to/from C/C++/Java

3) Perl has a much larger repository of open source libraries

4) Perl has much stronger/faster string handling (dynamic shader programs)

5) Perl simplifies embedding values within text blocks

6) Every function in Python can easily be performed in Perl; the converse is not true, particularly in terms of string handling.

7) Python has no defined global constants

8) Python has no forward referencing/prototypes

9) Python has no simple method of retrieving a dictionary/hash element's key

10) Python's print has no global method for enabling unbuffered I/O

11) Python's formatted print requires lists to be first converted to tuples

12) Python's print has no means to suppress both trailing new lines and spaces

13) Python has no ifdef method (short of reformatting) to block out prototype code

After going through these comparisons I decided to stick with Perl only, and learn Python to find the above truth only.

No comments: