![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Posts: 22
Rep Power: 0
![]() |
Python vs perl
can someone tell me the difference between these two..the pros and cos??
![]() |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
I view Python as a more general purpose language, designed to be readable. Perl is a monolithic beast that was designed mainly for text processing and then evolved into the clunky language that it is now.
Python follows the "there should be one, good way to do something" ideology. Perl adopts the "there should be many ways to do something to confuse people" stance. Python is compact - you can keep the language and a general knowledge of most of the standard library modules in your head. Perl is not compact. Python was designed to be readable and rewards good programming practices (for example making the docstring of any class/function available to you right from the script). It even forces good programming practices upon you (consistent indentation). I don't find Perl very readable, others may find it more so due to the fact that different variables (arrays, etc) are prefixed with a certain symbol. Python is a fully object orientated language providing excellent introspection. Perl is not such a language and does not provide as good introspection. Python scales well for large projects - they are maintainable and understandable after months of abscence. Perl scripts are apparently not (though I have no experience with anything larger than 100 lines in Perl). You can probably see that i'm a little biased so you may want to wait till a Perl advocate (if they exist?) comes along. ![]() |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
The fact that a common line of Perl looks like this:
@(&$)E*U) #@&P)N:UGE80u8e7*u.*&)u3/??>#cacugh3nt#(U\\.cuneu,hp.3 |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Well here's a contest that involved writing the smallest amount of characters in Perl to achieve a certain goal. A bit of a cruel example, but yeah..
http://terje.perlgolf.org/wsp/pgas/s...le=52&season=1 |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5
![]() |
... I guess these are the kind of replies you should expect when you post this question in the Python forum ...
You may want to have a search on Google and see if you can find a few comparisons of the two languages that aren't as biased. |
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() ![]() |
no need to overkill a solution, there is no one best language. as for me, If I had to choose I would go with Perl (don't kill me TCL)... mainly because I have more experience with Perl as opposed to Python.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#7 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|