http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
This is one of the factors why we have replaced Perl in our curriculum with Python. The other being that Python is far more fit for education.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
This is one of the factors why we have replaced Perl in our curriculum with Python. The other being that Python is far more fit for education.
Personally, I find Perl's $header2 = "Dear $title $name,";
to be more readable than Python's header2 = "Dear %(title)s %(name)s," % vars()
Another benefit to using sigils is that it's immediately clear when reading code what type of data is being referred to, while in other languages you often have to read back through the code.
On the other hand, Python has done a great job in positioning itself as the new BASIC (in a good way), and so of course Python gets much more exposure in the educational setting and thus has greater mind-share amongst younger coders.
Python is simpler and easier to learn well than Perl, but nevertheless Perl is a very powerful and useful language that takes a lot of undeserved criticism (e.g. see the comment of wyuenho in this thread).
Incidentally, I found the Google Trends link hilarious, as all the news snippets on the right of the page refer to people called Ruby and actual Python snakes (hey, maybe people are searching for things other than programming languages..)!
All I'm saying is, Perl requires too much more mental power to process than Python because of it's large vocabulary and inconsistent grammar rules. It is really a natural language, but a natural language is not needed for programming.
32.times{|i|i.upto(31){|k|putc~k&i>0?32:35};puts}
Oh, wait. That's Ruby. I meant to say:
<?for($n=33;$k=--$n;print~\xf5)for(;$k;)echo-$n&--$k?~\xdf:~\xdc;
Oh, sorry! That's PHP. My bad... here we go:
print map($%&$_?$":'#',0..~($%=$_)),$/for-32..1
There we go... You're right, Perl is so much worse!
The point is, of course, you can write ugly code in any language, or you can write beautiful code in any language. Python actually is fairly legible nearly all the time...
n=32
while n:print''.join('# '[-n&k>0]for k in range(n));n-=1
but that comes at the cost of added verbosity and reduced flexibility . Whether that's better is a matter of taste, not of fact.
I also disagree with the claim that a large vocabulary in Perl is a notable issue. The size of the Perl grammar and language is sufficiently smaller, in my experience, than the size of all of the library APIs that I have to deal with when writing Perl programs.
I agree on Python. I disagree for Ruby. It is a tossup. In most cases they are equivalent, Perl has autovivification, it is easier to interpolate functions into strings in Ruby. All in all it doesn't matter.
The TIOBE reference was to show that there are nearly always metrics that show your point.
But I guess it is easy to stomp on people based on presumption. Let's just stick to arguments, rather than poisoning the well.
Jokes aside, I think the sentiment has some strong truth - if for no other reason that there are some very heavy assumptions in the standard documentation that the user is well versed in Unix, shell and C libraries. "perldoc -f printf" and "perldoc -f sprintf" are _not_ what I'd expect first-programming-language learners to have to work with.
Unfortunately, the usual refrains of "patches welcome" are unlikely to solve this problem, because as a 2nd or 3rd (or 17th) language, it's precisely the documentation I want.