Ruby has method aliases. Python does not allow a string to capitalize itself.
Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function.
Ruby has strict object-oriented encapsulation. Python is laid-back about objects, because you probably know what's going on inside them anyway.
Ruby lets you leave off parentheses so you don't miss objects having attributes too much. Python will let you mix tabs and spaces for indentation, but passive-aggressively mess up your scoping as punishment.
Ruby has seven kinds of closures. Python has one, in the unlikely case a list comprehension won't do.
Ruby's C implementation is a mess of support for language-level flexibility. Python's C implementation is so clean you get the unsettling thought that you could probably write Python using C macros.
Ruby supports metaprogramming for cases when programmers find it more descriptive. Python supports metaprogramming for cases when programmers find it necessary.
Ruby is expressive. Python is direct.
Ruby is English. Python is Esperanto.
Ruby is verse. Python is prose.
Ruby is beautiful. Python is useful.
I like Python, but coming to it after using Ruby for seven years, well, I think it's like dog people and cat people. You can like having one species around, but you're always thinking -- why they can't be more like the other?
Ruby has method aliases. Python does not allow a string to capitalize itself.
>>> "hello".capitalize()
"Hello"
Python has decorators so you can write functions that return functions that return functions to create a new function.
Or functions that return classes, or classes that use other objects, or any possible other use for the pattern "wrap this with that and save the result"
Python will let you mix tabs and spaces for indentation, but passive-aggressively mess up your scoping as punishment.
$ ./mixed.py
File "mixed.py", line 3
print "b"
^
TabError: inconsistent use of tabs and spaces in indentation
I should point out that capitalize(), of course, returns a new capitalized string, just as it does in Ruby. But in Ruby you also have String#capitalize!
And as for indentation, I think Guido should have followed through with making tabs a syntax error, because they are part of the syntax and are fiendish sources of error. Let's just say you have this code, properly indented with spaces:
class X:
def visible(self):
pass
And you open it in a non-Python-aware editor, say for Windows, which has a four-space tab length and does not convert them to spaces. You add:
def invisible(self):
pass
at the end of the file using your tab key. Now you have a potentially crazy-hard-to-figure-out bug.
I should point out that capitalize(), of course, returns a new capitalized string, just as it does in Ruby. But in Ruby you also have String#capitalize!
So the quote deals with mutability? I suppose that makes more sense, since Ruby tends to favor mutable objects. Of course, to my Python-based mind changing the definition of 'a' or 3 seems like a poor idea.
And as for indentation, I think Guido should have followed through with making tabs a syntax error
Surely you mean "making spaces a syntax error"? That would be much more sensible, since using spaces for indentation is absurd. Even better would be simply ignoring spaces, since that allows them to be used for pretty-printing and alignment without any potential ambiguity.
Also, the bug in your example will not be difficult to figure out, because Python will/should raise an exception when parsing the malformed file. Not everybody runs with -tt, but that ought to be the default behavior (and is anywhere I get to control the installation).
Maybe you could consider a pre-commit hook which blocks /^\s* \t/ on * .py? Or if nothing else it's simple enough to grep/ack for.
I'd also recommend making indentation whitespace visible if your editor supports it - it is syntax after all. I have vim configured to colour leading spaces green, leading tabs as blue, and tabs following anything other than a tab highlighted red. Making inconsistent indentation ugly is quite effective, though sadly ineffective on other people.
None of these are reasons why Python is more prevalent than Ruby.
Also, i would point out that sometimes, expressiveness is useful :P
So sorry sir, but this isn't just biased, but also bordering on a troll. Bullet points like these are not justifications in themselves. They're just a list of things to try and DDoS an argument.
Ruby has method aliases. Python does not allow a string to capitalize itself.
Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function.
Ruby has strict object-oriented encapsulation. Python is laid-back about objects, because you probably know what's going on inside them anyway.
Ruby lets you leave off parentheses so you don't miss objects having attributes too much. Python will let you mix tabs and spaces for indentation, but passive-aggressively mess up your scoping as punishment.
Ruby has seven kinds of closures. Python has one, in the unlikely case a list comprehension won't do.
Ruby's C implementation is a mess of support for language-level flexibility. Python's C implementation is so clean you get the unsettling thought that you could probably write Python using C macros.
Ruby supports metaprogramming for cases when programmers find it more descriptive. Python supports metaprogramming for cases when programmers find it necessary.
Ruby is expressive. Python is direct.
Ruby is English. Python is Esperanto.
Ruby is verse. Python is prose.
Ruby is beautiful. Python is useful.
I like Python, but coming to it after using Ruby for seven years, well, I think it's like dog people and cat people. You can like having one species around, but you're always thinking -- why they can't be more like the other?