Recently there has been a big surge in popularity of both Ruby and Python. And with it came countless discussions on which one is better than the other. Volume of such discussions baffles many people, who think that the whole thing is pointless because the differences are very tiny, and both languages are converging anyway into some sort of Rython or Puby.
However this is completely backwards - the fight is so fierce because Ruby and Python are pretty much identical, not in spite of it.
There is a well-established principle in ecology called "competitive exclusion principle" which says that no two species can occupy the same ecological niche for a long time. They either get specialized, or one of them becomes extinct. A similar mechanism exists in many other fields - including programming languages. If you have two languages - like Ruby and Python, competing for exactly the same ecological niche, and one of them marginally better than the other, what is the purpose of the other language's existance ? Even if the difference is really tiny, who would want to use a less powerful language ?
If the difference in power is really tiny, like in case of Ruby versus Python, it would be reasonable to guess that it will take a very long time before one kills the other. However, "evolutionary fitness" of a programming language has two components:
- Power (expressiveness, performance etc.)
- Popularity (which results in more libraries, better tools, fewer bugs etc.)
Now Ruby and Python are almost identical. If you asked a Ruby programmer to take any language other than Ruby, Python would be the most popular choice. Likewise, if a Python programmer had to take a different language, they would most likely take Ruby. And in a few years one of them will survive and the other will either die or will get relegated to a small niche, and which of them survives depends mostly on which of them gets marginally better fitness right now - Ruby is a bit more powerful, Python is a bit more popular, and the situation is very unstable. The small difference today will get amplified.
So if you want Python to win:
- Reduce the gap in power - make Python support blocks, get rid of explicit self and get better support for metaprogramming. If Python did it a few years ago, nobody would have heard of Ruby. If you don't like blocks, metaprogramming and implicit self, you don't have to use them - simply consider them a price to pay for making Python the next big thing. If it gets them today, it is still very likely to win.
- Reverse gap in power - can Python express certain things a lot better than Ruby ? Write useful programs and libraries that would be much more difficult without this power and popularize them. Attack the enemy where it is strongest.
- Make the most of greater popularity - work on useful things that are very useful but hard to reproduce with smaller user base - like Psyco and stable ports to JVM and .NET.
- Increase power advantage - take powerful features from Lisps, Smalltalk, Erlang, Haskell or whatever, and integrate them with Ruby - making different paradigms work together is one of the greatest strengths of Ruby, so make use of it. Make metaprogramming and DSLs easier by writing metalibraries and tutorials.
- Make the most of greater power - Ruby was able to get the momentum with Ruby on Rails, which would be very difficult to replicate in other languages. Ruby makes writing powerful embedded DSLs very easy, and powerful embedded DSLs are a potentially huge and pretty much unfilled niche. Take it and use it as a leverage to get more popularity.
- Minimize effects of lesser popularity - if Python has a good library for something, simply recode it to Ruby and call it version 1.0. The languages are so similar that you should be able to do it in no time. You can get it more Ruby-like (with blocks etc.) later.
- There are some things in which current implementation of Python is simply better - Ruby 2 is trying to fix many of those (you cannot have Ruby Psyco without YARV). If you can - help with Ruby 2.
- Steal every single cool feature from the other language, indiscriminately. You can deprecate the ones that didn't work later.