6 ms·
C is more efficient than both of them. For that matter, so are tons of other languages. For that matter, I'm not sure what you mean when you say Perl is "natur
by Hizonner 5y ago
C is more efficient than both of them. For that matter, so are tons of other languages.
For that matter, I'm not sure what you mean when you say Perl is "naturally more efficient" than Python. There's nothing about Perl that makes it easy to run faster, and the ability to write incomprehensible one-liners is not a very satisfying measure of "efficiency".
As for why people choose Python over Perl, Perl is a pain in the ass in a lot of ways, and I say this having written thousands of lines of Perl back in the day. Dollar signs on variable names? Obvious bad code turning out to be syntactically correct but do weird stuff, because of strange irregular legacy syntax rules? Library code being unreadable because of the aforementioned incomprehensible one-liners?
Python is bad enough about not finding errors until the code blows up in weird ways, but Perl is worse.
- xkahn 5y agoThe design decisions of the Python language (arbitrary length integers for example) lead Python to just be SLOW. It's much slower than Perl. Don't believe me? Look at how numbers are stored: https://rushter.com/blog/python-integer-implementation/ https://rushter.com/blog/python-integer-implementation/ But it doesn't really matter. Computers increase in speed over time. Libraries allow speed sensitive sections to use more sane data types. As you pointed out, the Perl language's design decisions cause much worse problems -- hard to identify bugs.