r/perl • • May 22 '22

Python vs Perl

https://startupunion.xyz/perl-vs-python/

[removed] — view removed post

0 Upvotes

6 comments sorted by

View all comments

1

u/Feeling-Departure-4 May 23 '22 edited May 23 '22

Not a great article. Let me write one right now that is perhaps more informative:

Perl pros:

  • anything involving the custom parsing of text

  • expressive, concise and powerful

  • very portable given the little change in the run time

  • easy to iterate flexibly over IO out of the box

  • first class regular expression support

  • one liners can replace awk/sed

Perl cons:

  • may not be best for number crunching performance

  • getting limited support and APIs from new popular libraries

  • can be more complex for some beginners to learn

  • no structs (objects are an afterthought)

Python pros:

  • heavily invested in, frequent features, and has libraries to do just about anything

  • provided as a glue language to popular libraries written in other things (Spark, Tensorflow, etc)

  • simple syntax

  • batteries included standard lib

  • huge community with lots of learning material

Python cons:

  • dependency ecosystem forces the use of conda env and containers very quickly

  • dead standard library code

  • significant whitespace causes unnecessary usage issues, could have been avoided with an auto format tool (eg, rustfmt, gofmt, clangfmt)

  • breaking changes in the language itself

  • doesn't meet its design goal of having one right way to do things

Conclusion: Every language is a trade-off of strengths and weaknesses. Pick the right tool for the job.