Tuesday, February 23, 2010

Python vs. Ruby

Days ago, while Guido was in PyCon, he posted a tweet about a lecture comparing Ruby & Python. That was a good one for that it mentioned pros & cons of both languages. As I tweeted before, it is evident that Ruby's syntax is much more flexible than Python, but also as Guido say, this type of flexibility (freedom) reduces the readability significantly. I confirm Guido's opinion when I review a Ruby project code. Alongside with all these, I have more reasons for choosing Python over Ruby, but I confess most of these reasons are matters of taste, rather than - so called - technical proof. Ruby testing facility is evidently very strong in compare with any other language I think. Anyway, if we decide to compare Ruby with a rival language, of course none can be like Python. I like the book name "Thinking in Python", since Python is really a method of thinking, not only a programming language.When you think in python (That is a matter of taste), you do not like overriding the whole syntax. I am not a conservative programmer, but not a unrestrained at the same time.In Ruby, you can make the string class not to be a string! How can a developer read your code so? Of course, Ruby people say no one does this, because we appreciate our freedom and do not abuse it! Anyway, review my reasons for choosing Python:

1. In Ruby you have too much freedom, which I dislike.(You may like it!)

2. I would rather to have a more readable code, than a complicated one. (You may not!)

3. I like to choose from various HTTP frameworks (TurboGears, dJango, web2Py...), rather than sticking to - although more sophisticated and complete - Rails. (Do you ?)

4. I prefre SqlAlchemy over ActiveRecord and CherryPy over Mongrel! (Taste!)

5. Google is already using Python. (Twitter uses Ruby!)

6. I dislike to have many various ways of doing the same thing. Instead, I like to be forced to do it in the most sophisticated way, as in Python. (You may prefer Perl/Ruby method of thinking!)

7. Python has a very smooth learning curve, which means I can add more developers to the project if needed. I guess I can find developers thinking in Python, more easily than ones thinking in Ruby. I think I will even struggle with Pythonic ones easier! (I learned Python in hours, but still don't know Ruby!What about you?)

8. Python is truly more documented, and mature.

All these, may vary for you or someone else. Please comment if you agree or disagree.

1 comment:

  1. Why ruby? Metaprogramming (think dsl) is the only reason I can think of.
    Btw being a .net guy ironpython rules!

    ReplyDelete