Perl vs Python

chronodekar

Senior member
Nov 2, 2008
721
1
0
I'm thinking of learning something new. I already know a bit of Perl, but before I forage too deep into it, I want to know, how is Python?

What are the kind of tasks that both are used for?

I hear a lot about Python, but I've never seen it myself.



Random thoughts:
It was a hard choice deciding where to post this. the *nix section or here. In the end, since I'm more familar with the Programming folks, I decided to post here.
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
I'm somewhat new to the LAMP side of things but in my explorations thus far Python just seems more vibrant. What I mean by that is it seems to have a bit more energy behind it in the OSS community. Check out some of the frameworks like Django, etc. Python also seems more straightforward to me. Perl has always seemed so obfuscated and opaque to me. Sorry for the brainy terms but that's exactly how it seems to me... almost needlessly so.
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Python's the new, popular language. Perl is still used everywhere, though, so it's worth learning as well (and is my personal favorite). Both are good to know. They can be used anywhere scripting languages are commonly used, e.g., web programming, *nix scripting, data processing, etc.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,360
4,066
75
Python is definitely for the future. It has real data structures, OOP, and references aren't bolted on. Probably most importantly, it's got momentum.

What I like better is Perl, but only because I've used it for over a decade. Plus I hate Python's indent-based structure; but not quite enough to write that PyBrace brace-to-tab-and-back translator I keep thinking about.

Perl is nice for a quick script; but once you get used to Python, I'm sure it's just as quick. The only other real downside I've seen to Python is that you can't do "python -e"; but on the other hand you can type Python at a prompt.
 

lebe0024

Golden Member
Dec 6, 2000
1,101
0
76
Ruby! This is how I judge languages as far as "usability":

1) terse-ness. I want to type as little as possible.
2) OO-support. I want it to be easy to work with classes.
3) data structure and iteration support. I want it to be dead simple to create common data structures and iterate through them.

By these three criteria, python wins. All have #3 down. But only python gets all three. However, I will say that Ruby is by far my new favorite. It does all three better than Python even. If you haven't tried it, you should. I used to be a big LAMP guy too, until I tried Ruby on Rails. PHP seems archaic to me now.

 

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
Originally posted by: lebe0024
Ruby! This is how I judge languages as far as "usability":

1) terse-ness. I want to type as little as possible.
2) OO-support. I want it to be easy to work with classes.
3) data structure and iteration support. I want it to be dead simple to create common data structures and iterate through them.

By these three criteria, python wins. All have #3 down. But only python gets all three. However, I will say that Ruby is by far my new favorite. It does all three better than Python even. If you haven't tried it, you should. I used to be a big LAMP guy too, until I tried Ruby on Rails. PHP seems archaic to me now.

PHP is about as close to C/C++ as you are going to get in a web enabled language. While Ruby on Rail's makes Ruby a very robust web language it doesn't make PHP archaic. RoR has absolutely no comparison to PHP. You need to compare Ruby to PHP and a framework such as codeigniter to Ruby on Rails.

RoR does a lot of nice things but if you spent a project with codeigniter I think you'd be suprised.
 

chronodekar

Senior member
Nov 2, 2008
721
1
0
Now before we go a bit off-course, while I think Ruby and PHP are nice (I've used PHP, but don't know how to program it)

I think we should try and keep this discussion to general languages. IMO Perl and Python can be used both offline and for web applications. Or am I totally wrong ?

 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
Technically any of these languages can be used for offline or web applications (or any other application you want, really). PHP is really not designed to be used offline, though, hence I would avoid it. The others were all originally made as general purpose languages (Ruby, Perl, and Python) and just happen to also be used in web apps.

Really, it's pretty subjective as to which one you should pick. They are equally capable languages. Take a look at a little of each and see what you think.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
I only do a little server coding but PHP seems to be the the most popular server script language now for 'nix developers not using Ruby or JSP. Perl use seems to have declined a lot since 2001-2 when we were using it at work.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Perl hasn't gotten much press lately and Python seems to have picked up in that area, but I still prefer Perl and 99% of the time whenever I want to do something complicated CPAN has a module that handles the heavy lifting for me.
 

Dravic

Senior member
May 18, 2000
892
0
76
Perl has CPAN which a big plus, but Python has the current momentum. I would learn perl because its installed on every non MS enterprise OS by default, but I would also start learning Python because it appears to be the heir apparent. On the Linux side Python has pretty much taken over as many of the admin tools are now coded in python.

Python is easier to learn IMHO, but Perl will keep you employed
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
On the Linux side Python has pretty much taken over as many of the admin tools are now coded in python.

Which is sad because the main reason that yum sucks so bad is because it's in Python...
 

nova2

Senior member
Feb 3, 2006
982
1
0
uh really

just learn both.

if you have bad memory (as ESR complained now in his 40s or 50s) you might want to learn python first
 

chronodekar

Senior member
Nov 2, 2008
721
1
0
Well, I'm tipping to Python now. All I need is some good place to learn it from. Any suggestions guys?

Books/online links ?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |