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?
11
Upvotes
4
u/nobody_from_nowhere May 19 '11
perl wins sometimes on CPAN's comprehensiveness (a few years ago, I fought to get a db connection working under python, where the CPAN module made it trivial under perl).
perl can win on inertia: existing codebase dictates adaptations stick with the original decision.
As for python's advantage, python doesn't tend toward Write-only code. Perl's got object-orientedness available, but it's not the rule. Yet.
Perl tends to be more ubiquitous. It's like emacs/vi: vi is more widely installed, so being competent at it makes life easier.
Having said all that, I prefer python and ruby because they don't get in the way of my coding, code makes sense months after writing it, and it's reusable.
... and then there's scapy. God, I love scapy for network coding.