Live data from Hacker News

Ask HN: Why Python over Ruby?

news.ycombinator.com

1–10 of 198 posts

Ask HN: Why Python over Ruby?

#1
I would like to understand why Python is so much more popular than Ruby. Much of the software I've seen supports Python for scripting (e.g. Miro, OpenMoko, XBMC/Boxee), and people don't seem to care so much for Ruby. At the same time, people agree that Ruby is great for writing DSLs.

I don't want a flame war or religious arguments. I would like to understand what made Python win in this space. Thanks so much for commenting!

Re: Ask HN: Why Python over Ruby?

#2
One major problem with Ruby has been that the performance as been much slower than Python. This is no longer true with Ruby 1.9. I happen to have done a benchmark using a recursive Fibonacci algorithm yesterday, results: http://pastie.org/528717 source: http://pastie.org/528720

I wouldn't say Ruby has lost just yet.

Re: Ask HN: Why Python over Ruby?

#4
I haven't really looked at Ruby that hard, but from my perspective as a reformed Perl user I found Python's syntax to be very clean and well organized. On the surface ruby looks more Perl-like to me, more clutter, not as easy to read as Python.

Having found Python, I really don't feel a pressing need to learn another scripting language. Instead I'm working on Objective C.

Re: Ask HN: Why Python over Ruby?

#5
Speaking purely for myself, the only reason I switched from Perl to Python is I had a great deal of difficulty understanding the perl code (because I'm a poor perl scripter) I wrote after a day or so. That, and the language construct HashOfArrays and ArrayOfHashes is exceedingly difficult to do in perl without referencing a manual. The only (Edit: Alternative scripting) language really out there with mindshare in 2001 was Python. I was able to read my python code. I never had to look at a manual to implement complex data structures. As a bonus, I can type "help(command) or dir(command) within the python CLI. I've never really had the need to switch to another environment. Ruby might actually be 10x better and faster for my typical tasks than python for all I know.

Re: Ask HN: Why Python over Ruby?

#6

One major problem with Ruby has been that the performance as been much slower than Python. This is no longer true with Ruby 1.9. I happen to have done a benchmark using a recursive Fibonacci algorithm yesterday, results: http://pastie.org/528717 source: http://pastie.org/528720 I wouldn't say Ruby has lost just yet.

I don't think performance is holding ruby back I think that libraries especially mature and massive libraries, or lack thereof, is holding ruby back. Not to say people aren't working on it give ruby some time it will probably catch up especially with rails but just not right away.

Re: Ask HN: Why Python over Ruby?

#7
For me personally, it boils down to me liking the library more, the syntax more and the common programming styles. Ruby is very hard to follow me due to the (imho) overuse of meta-programming and using language constructs that obscure the actual meaning of the program. Patching objects and being overly clever with language features makes ruby code harder to read.

It's also, to me personally, a lot faster to whip something up in Python than in Ruby, even when I knew them at about the same level.

Re: Ask HN: Why Python over Ruby?

#8
post #6

One major problem with Ruby has been that the performance as been much slower than Python. This is no longer true with Ruby 1.9. I happen to have done a benchmark using a recursive Fibonacci algorithm yesterday, results: http://pastie.org/528717 source: http://pastie.org/528720 I wouldn't say Ruby has lost just yet.

I don't think performance is holding ruby back I think that libraries especially mature and massive libraries, or lack thereof, is holding ruby back. Not to say people aren't working on it give ruby some time it will probably catch up especially with rails but just not right away.

Performance has always been a finger in Ruby's eye, but with 1.9 that doesn't seem the case.

Regarding libraries; you are right. Ruby has a lot of code out there, but much of it is in random repositories maintained by random people. Hopefully this changes.

Re: Ask HN: Why Python over Ruby?

#9
Ruby is slightly newer and wasn't particularly popular in the United States until it was popularized by Rails.

Python became popular with Linux and open source developers before Ruby did, and has had slightly more time to develop a nice set of libraries to do just about anything.

Post reply on HN