Ruby is nicer to read than Python. Here's how each language reverses a string:
# Ruby
string.reverse()
# Python
string[::-1]
Which looks better?
Edit: I'm not sure why this is being down voted. It's a true statement.
Edit2: With all the down voting on Hacker News recently, I'm about to quit sharing my knowledge here. Maybe pg will do something about this. It needs to change otherwise good people will stop posting here.
I think possibly because it's 'fiddling around the edges'. Sure, it's nice to have a way to reverse a string, but you don't do that very often in practice - assigning to lists, calling functions, etc. are all far more common.
# Ruby
string.reverse()
# Python
string[::-1]
Which looks better?
Edit: I'm not sure why this is being down voted. It's a true statement.
Edit2: With all the down voting on Hacker News recently, I'm about to quit sharing my knowledge here. Maybe pg will do something about this. It needs to change otherwise good people will stop posting here.
Edit3:
irb(main):002:0> x = "hacker"
irb(main):003:0> puts x.reverse()
rekcah
>>> x = "hacker"
>>> print x[::-1]
rekcah