About 6 months ago I decided to learn either Python or Ruby because I wanted a language to write webapps and simple computergames fast.
I kind of tried both for a while and Python gave the better impression in every way, readability, ease of use, libraries, documentation, expressiveness etc.
But there are so many really enthusiastic posts about Ruby and while Python has a lot of users and is very popular and successful I rarely see anyone rave about it. But maybe that just means it has gotten mainstream.
But anyway I like the Python philosophy that there should preferrably be one obvious way to do things.
While similar in most ways, there the languages differ.
So, what do you Rubyists like so much about Ruby? Especially what do you think Pythion lacks?
I lived with Python for 4 years before I lost an argument at my own company and had my project moved to Ruby. I've since moved in with Ruby and haven't looked back.
* Everything in Python feels like a symbol table hack. Private methods? We have those! Just exploit this bug in the class symbol table lookup code!
* First-class symbols. There may be little difference under the hood between a Ruby interned string and a Python string atom, but there's definitely a difference syntactically. This is a difference that is hard to articulate, but if you've written much C, it's like having every "enum" you could ever want predefined for you, and completely eliminates "magic numbers".
* Blocks and lambdas. I've read GvR's take on this. I know he thinks a named function is just as good --- maybe even better! --- than an anonymous function. I had nested named functions/functors in C++ and Java. Even Tcl "uplevel" is better than Python's castrated lambda.
* Method definitions in Ruby don't need to accept a "self" argument. Again: all of Python feels like a symbol table hack to me.
* Ruby has first-class Regexps. Python has an "re" library. You know what else has an "re" library? C.
* I haven't found an expression that is better written as a list comprehension than as a map/reduce/select expression.
There are painful things about Ruby:
* The FFI is immature. Outside of Common Lisp, Python ctypes may be the best FFI out there.
* I never got Python to crash on me (at least, not where it was Python's fault). I crash Ruby once a week.
* Ruby is palpably slower than everything. If performance matters to you and you don't know C, you may be better off in Python.
* The community is led by the nose by Rails developers, which can at times feel like a worst-of-all-worlds grab bag of methodology programmers, web designers, and dabblers.