Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

The better comparison is to Perl. Everyone used to say that there was no way Python could replace Perl because Perl had such a big ecosystem.


sort by: page size:

Python was never intended to replace Perl. Perl was designed to extract stuff from text files. Python was designed as a scripting language for system programming. IM(Seldom Humble)O Python beat Perl for two reasons (a) batteries included (CPAN became a clusterfuck) (b) C API lead to stuff like SciPy, NumPy and Pandas.

FWIW I've used both Perl and Python professionally and Python rules.


Dude, python IS in the same bucket as perl. The list of pros and cons when compared to C is identical.

Realistically, Python is as ubiquitous as Perl these days.

Python had a number of similar competitors a few years back, the main one being Perl. Python is better than Perl for certain tasks, the syntax encourages writing more readable code. Personally I like Perl, but if I am doing anything non trivial, Python will give me more maintainable code. Perl has a more expressive syntax, which is both a blessing and a curse.

Then you have PHP, which is (or at least was) an inferior langauge to Python when python started getting popular. Python does more that just web dev. Likewise with Ruby.

Python could easily be described as "better" depending on the task.


+1 for mentioning that python's original competitor was Perl. This point is forgotten some 20-30 years latter

As someone who began his programming career with Perl I've never understood this idea that Python somehow improved on Perl. For a start Ruby is Perl5's most obvious successor. Perl puts Python's text-handling to shame whilst Python's lambda is nowhere near as expressive as Perl's. Python also goes head-to-head with Perl's fundamental philosophy - TIMTOWTDI. If anything Python is the Anti-Perl.

Python pretty much replaced Perl in everything yet Perl is alive and well today. So, no.

Agreed that Python still isn't as good at Perl at command-line scripting (which isn't a denigration; Python is good at it, but Perl was born for it). Also agreed that Python's current trajectory is buoyed by data science (compare Ruby, whose ascent via the web went hand-in-hand with Python, but which never took off for other domains and faded as new languages entered the web space). But that's a separate phenomenon, and probably has even less to do with comparisons between Python's and Perl's syntax (for years the data science crowd has been demanding more syntax from Python, e.g. a dedicated operator for matrix multiplication).

I would always use Python over Perl for ad-hoc scripting jobs above a trivial level of complexity, but would worry about its performance vs Perl for more permanent tasks. Worked on a codebase that has a lot of Perl glue, including a lot of text munging, and tbh whilst rewriting that stuff in Python would mean that it's not reliant on grey old geezers to maintain it, I would worry about the performance hit. Wonder if commenters have any explicit comparisons they could share.

Perl was very popular and I think Python got its boost from being seen as the more sane replacement to it. At that time nothing else really offered to solve the pain of Perl in the same way except Ruby and Ruby was even slower

Agree with everything except Perl. Python is the new and better Perl.

What other languages are you comparing against? I came to Python from Perl and the one-way-to-do-it-ness was noticeable and refreshing.

Could you talk more about “BTW: perl is much better than python on this.”?

I don't understand why Python is touted as some kind of replacement for Perl when there are many things Perl does better and faster. Python isn't even optimised for one-liners so how can it be compared with Perl?

I don't think Ruby and Perl are a good comparison to Python 2 and 3. Perl 5 and Perl 6 would be a better comparison.

The best thing about Perl in comparison to Python is that programs written in Perl age very well. You can run decades old scripts without any updates, versioning and/or dependency hell or other headaches. Even better, also across platforms. I stopped using Python because of the anti-experiences with all that.

Sure, but the same could be said about Python. In the early 2010s, Perl still reigned supreme in my field, yet Python usurped it, despite having no concrete advantages over Python except a better design.

And of course, Perl also replaced an existing language. It's not like people settled on Fortran in the 1950s and then never moved on.


Python is very much alive. Not sure where you’re getting that. Perl 6 and Python 3 aren’t really remotely comparable, either.

You have a point. Python was definitely pitched as a perl replacement. We forget because it pretty much won.

Lua has it's own problems, of course, but I don't see it as a language developed as a consequence of frustrations with another.

next

Legal | privacy