in reply to Perl vs. Python: Looking at the Code
Some good points here:
Some of the points are awful:
No "concrete examples" to show this; a study of a short program implemented in both languages would go a long way to convince Perlers of this. Especially given that the claim is a bit odd -- most Pythoners I spoke to were enamoured of their language's verbosity, and said that made it better than Perl.
But WHY is this a measure of language quality? Surely Perl wouldn't be a better language if we removed length, on the grounds that y///c is one keystroke less?
Here's what put me off Python:
When people say Perl lacks closures, they mean you have trouble if you define a named sub inside a named sub (and try to return it). Python is much worse, though: it invents a new concept of "scope". You have "outer scope" (globals, really) and "inner scope" (dynamic variables, like local creates in Perl). You cannot write
because `x' is lost. The manual says to fudge it with default argument values, by drilling your variables down into the scope:def adder(x): return lambda y: x+y a = adder(5) print a(3)
This is horrible! After a=adder(5), a(3) gives me 8, but so does a(4,4).def adder(x): return lambda y,a=x: a+y
Closures aren't some academic abstraction; for instance, they probably form the basis of the most readable, intuitive style for coding Perl/Tk (or any other GUI).
Surprisingly, most of Python's real advantages have been eliminated, too!
|
|---|