My $0.02
There are many reasons why Perl is preferable over Python. To summarize them all. I think Perl is still the only option in your tool set if you get a task at 1 in the night and expected to finish that in an hour. That means that there are a certain things that about Perl that make it the best scripting language in the class. Sure everything that is possible in Python is possible in Perl too, but that sort of mathematical possibility is not what tools are about.
1. Flawless integration with the UNIX system. The language has perfect integration with the shell and the entire UNIX system as a whole. As far as text processing is concerned no other language holds even a candle to Perl. Any thing to do with the word text and there you go, all you need and have is Perl. Python has text processing too, but it looks so cumbersome and difficult that it becomes a pain as soon the number of regexes hit anything more than 5. You get caught up in an never ending mess of compiling, matching and catching exceptions even for simple tasks. On top of that functions like grep, things like qr and smart matching features of Perl make text processing not just easy but look so natural and native to the language. Regexes are first class citizens in Perl, now that's another added advantage. Try the combination of iteration, smart matching and too many regexes in Python, You will instantly realize what sort of mess Python code looks like.
2. Freedom, Power, Flexibility and rapid pace of getting job done. As Chris Prather says - Perl prefers configuration over convention in Code!. Python on the other hand is designed with restriction and sacrifices too much power, flexibility, freedom and pace of getting job done to achieve what it calls 'Readability matters'. I don't know about others but I prefer a sharp double edge sword to a blunt one. I mean to say, Perl will help you be creative. It will make you thing in many ways. It will help you come out will many solutions and good solutions over time. I prefer freedom and power over bluntness. Python's claim that it helps people write good code automatically is foolish. Only thing that solves a bad programmer problem is a good programmer. For me this whole idea of restriction of freedom to the programmer is the biggest reason why I hate Python. Anything that comes in between my freedom and creativity is not for me. Besides a tools that forces you to be something, will eventually group you into same group of fools who were themselves forced to be so.
3. CPAN, Nothing like this exists in other language. And only seeing it manually can make you believe it. By the time one can think of a 'only one way to do it' solution in Python, You would have solved the problem with CPAN.
4. The Perl community. Perl monks, the mailing lists, the helpful people. And people with the most passionate hackers in the community.
5. Stable and back ward compatible software. Perl hasn't broken backwards compatibility since its existence. Python on the other has broken backwards compatibility to modify just a print statement and a couple of iterators in Python 3. With Perl I can be sure 4-5 years down the lane the porters will ensure my old code runs smoothly then. With Python I would have worry about the migration mess.
6. Evolution and syntactical flexibility with backwards compatibility. Advances like Moose and Devel::Declare(And all associated modules) give the power of extensibility without worrying about breaking backwards compatibility.
Of course a detailed analysis will run into volumes. But its not exactly the technical stuff that attracts me to Perl. Its the Perl philosophy.
In reply to Re: perl python compare
by Anonymous Monk
in thread perl python compare
by bhupeshwalde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |