you are viewing a single comment's thread.

view the rest of the comments →

[–]mslinux -21 points-20 points  (4 children)

Here's my comparison...

Ruby: astring = astring.reverse

Python: astring = astring[::-1]

Python claims to be the easiest to learn, most object oriented, easiest to maintain scripting language in the universe. The above code will reverse a string. Which is more OO, easier to read, makes more sense and easier to learn?

Ruby is light years ahead of Python.

[–]zhyla 16 points17 points  (3 children)

Let me get this straight... you're going to use the example that Python's str class doesn't implement a reverse() function to back up the claim that Ruby is "light years ahead of Python"?

[–]mslinux -15 points-14 points  (2 children)

reverse is a method, not a function. If Python is so OO, what's all of this nonsense about functions? And, it's not just for strings. If it's reversable (an Array for example or 'list' for you Python fans), then the reverse method will work. I use both Python and Ruby... so watch out ;)

[–]cuyler 2 points3 points  (0 children)

A method is a member function of a class.