Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 7th, 2005, 1:15 PM   #1
anandt4u
Newbie
 
Join Date: Feb 2005
Posts: 22
Rep Power: 0 anandt4u is on a distinguished road
Python vs perl

can someone tell me the difference between these two..the pros and cos??

anandt4u is offline   Reply With Quote
Old Apr 7th, 2005, 2:07 PM   #2
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
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.
Cerulean is offline   Reply With Quote
Old Apr 7th, 2005, 4:01 PM   #3
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
The fact that a common line of Perl looks like this:
@(&$)E*U) #@&P)N:UGE80u8e7*u.*&)u3/??>#cacugh3nt#(U\\.cuneu,hp.3
uman is offline   Reply With Quote
Old Apr 7th, 2005, 5:24 PM   #4
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
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
Cerulean is offline   Reply With Quote
Old Apr 7th, 2005, 7:19 PM   #5
sykkn
Hobbyist Programmer
 
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5 sykkn is on a distinguished road
... 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.
sykkn is offline   Reply With Quote
Old Apr 7th, 2005, 11:12 PM   #6
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Apr 8th, 2005, 7:01 AM   #7
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Quote:
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.
Or post in the Perl forum as well.
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:06 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC