Python vs. Ruby

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

My Background

I have a ton of experience with Python. I've been programming in it as a hobby since 2000, and professionally for the past 3+ years.

I don't have a lot of experience with Ruby. Every time I've tried to get into it, I've become frustrated and decided to give up on it. It didn't show any hope of being better than Perl or Python.

I am going to be brutally honest here, and terribly biased. Of course I am biased. I've investigated almost all the other languages around and I ended up settling on Python.

Why Not Ruby?

Ruby's biggest flaws are in its language. The language is simply messy. There are too many inconsistencies, weird characters, and magical behaviors. If I wanted Perl, I would program in Perl.

Ruby has some nice features, but they are not compelling enough to adopt all of Ruby. These features are very common in other languages.

The areas where Ruby fans claim to excel over Python is in ways that make the code less readable and less understandable. Sure, you have some shortcuts that mean you have to type less, but it doesn't help make your code more readable and easier to understand, or, frankly, easier to write.

Ruby's community is significantly less broad (in terms of diversity) and less polite. Other programming communities offer a nice cross-section of society at large, with engineers and scientists over-represented. Ruby's seems to lack the deep scientific appeal and the extensive engineering community.

Ruby's module library is much smaller than Pythons. I'd compare today's Python module offerings to what CPAN had 5 years ago.

Why do People Choose Ruby?

I can't speak for others, but this is what I tend to see.

As with every blanket statement, there are a lot of exceptions.

Most of the people who code in Ruby come from the PHP background. Almost anything is better than PHP, and at a time when a lot of PHP people were looking for a new language, Ruby and Ruby on Rails was getting a lot of attention.

Python's web development environment was too diverse, and still is. If you want to move from PHP to Python, you're going to have to pick a platform and stick with it, which is really hard because there is so much cross-pollination in Python.

Perl and almost all of the other languages are far too complicated for PHP programmers to wrap their heads around.

So, Ruby became the next logical progression.

Some of the attributes I tend to see in Ruby developers is:

  1. A lack of seriousness about programming.
  2. A willingness to compromise code quality to get the job done
  3. A lack of curiosity about programming, web development, and other very technical topics.
  4. A willingness to stick with the crowd and convention rather than experiment on their own.

The end result is that once they find something that does the job, they stick with it rather than keep exploring.

Ruby & MySQL

My complaints about MySQL mirror my complaints about Ruby. You'll note that whereas in the Python community, PostgreSQL and other databases are well-represented, it seems like MySQL is the only database that people know about in Ruby.

What Does Python Have?

  • Python's syntax is much, much simpler, consistent, and easier to read and write.
  • Python's module library is huge.
  • Python's community is broad, polite, and deeply knowledgeable about a vast number of subject areas.

Here is a list of things that the Reddit community has provided. Note that they are much more polite than I am.