• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Perl vs Python

chronodekar

Senior member
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. 🙂
 
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.
 
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.
 
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.
 
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.

 
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.
 
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 ?

 
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.
 
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.
 
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.
 
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 🙂
 
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...
 
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
 
Well, I'm tipping to Python now. All I need is some good place to learn it from. Any suggestions guys?

Books/online links ?
 
Back
Top