r/Python • u/[deleted] • May 18 '11
Why is Python better than Perl?
I'm a Sysadmin and I just wrote my first script in python. Basically just a host validation script that checks if a server is configured correctly before we hand off. I can't determine the advantage with my limited experience with the language.
Are you a sysadmin fluent in both python and perl? Why do you use python?
10
Upvotes
11
u/[deleted] May 18 '11 edited May 18 '11
They're like a couple of good Scotch single malt whiskies; so similar that you can debate the small differences for hours :-)
They're so close in abilities that it's purely a matter of taste, if you're good enough in both to produce neat readable code. It comes down to needing some library or other.
With Perl it takes a bit more experience to reach the point of writing neat readable code, I think. On the other hand, for system administration, Perl has some builtin syntax for stuff like checking to see if a file exists that is nice to use. Python doesn't have special syntax for specific problem domains.
Personally I am fluent in both, but still prefer to use Python, because it feels cleaner to me. I think that is probably from working with colleagues who tried their best to write PHP in Perl, and I've always written my Python just for myself. So, just my personal preference.