After being a very happy Python programmer for 2 years, i have switched to Ruby a few months ago, and though Python is still
my 2nd favourite language, i have never thought of going back to it for a second. In fact, this feeling was so
natural that i did not even think about it’s reason for some time.
If someone compares these two languages just from the technical point of view, the difference is de facto non-existent.
Both languages are built on similar principles, both of them serve essentially the same purpose. What is the secret
sauce of Ruby then? Why did i get attracted to it immediately, past the point of no return? Here are a few points that came to my mind:
‘He is the ONE‘
- If a beginner stumbles onto Ruby, there is ONE book he will be pointed to. The PickAxe.
- If somebody asks which web framework should he use in Ruby, he will be pointed to a specific ONE: Ruby on Rails.
- If he asks for a starter book on RoR, he will be advised to buy the coolest ONE: Agile Web Development with Rails.
- If he asks for a discussion list/newsgroup, he will be pointed to the only ONE: ruby-talk.
- If he looks for an XML processing library, he will be pointed to the standard ONE: REXML.
The list could go on and on…
A Rubyist with no previous Python experience may ask ‘Well, what’s so cool about this? It’s normal’. Well, i am glad that in Ruby is, but Python is a different story. I think it lacks the books like PickAxe and Agile Web Development with Rails, and also the community is divided up between Django, Turbogears, Pylons, Subway, … and the other dozen of web frameworks.
nice application of the DRY principle
Rolling on Rails
If you would ask random people to summarize in one point why Ruby is so popular today, i am quite sure most of them would say ‘because of Ruby on Rails’. This framework is really that cool, believe it or not. Some people are already apostrophing it ‘the language/framework of web2.0′, pointing out that Rails is the next big thing in the web space.
Spread the word
A programming language is essentially a bunch of boring definitions: Some grammar, rules, constructs etc. Even if it is very very cool, no one will notice it unless it is evangelized. That’s why great stuff needs great evangelizators: Perl+Larry Wall. Microsoft+Bill Gates. Ruby+DHH.
To follow the logic, i should have written Ruby+Matz. But i would not write Matz, just as i would not pair Python with Guido van Rossum in this sense. These smart gentlemen are really good at language crafting, but the analogy with Perl/Larry Wall stops here. Fortunately Ruby has a great evangelizator, too, although an ‘indirect’ one: David Heinemeier Hansson, who, in my opinion made Ruby really popular through the Rails framework.
After a few dozen of mails, i have much much better experience with the ruby-talk ML than with python-tutor. Of course one should not judge based on a few dozen mails, but the Ruby community feels to me like a big family, whereas the Python community is more like a bunch of engineers in white suits. Matz’s ‘Why does Ruby suck’ kind of style appeals me much much more than Python’s agnostic approach – ‘Maybe it is not even sure that there is a problem – first you should define what do you think the term ‘problem’ means, anyway’ etc. Of course this rigorous style may appeal to some – but not for me.
Integration [with Java]
From the JRuby page:
[JRuby is] A 1.8.2 compatible Ruby interpreter written in 100% pure Java
On the Jython page, i could not even find the compatibility with java – but according to the page, “The final release of Jython-2.1 occurred on 31-dec-2001″
For comparison: Ruby 1.8.2 is almost the latest stable, and JRuby’s last release was on 27-march-2006. JRuby makes also some Rails integration possible already, and the authors are focusing on other J2EE issues like calling EJBs etc.
I think in a world where Java is the king of the hill (at the moment), Java integration can be a deciding factor.
T-shirts. Cofee Mugs. Baseball caps. Other kind of good-for-nothing junk – must haves for all geeks! Of course with their favourite stuff on it. Well, after looking on cafepress.com (and on google in general) Ruby is a winner again when compared to Python.
The list could continue on, but since this entry is already too long i am going to stop here Of course, as everything on this blog,
this article reflects my opinion, my perception of Ruby/Python. If you think Python is better suited for you, i am not arguing or anything – it would not make sense. However, i think Ruby has much more potential to become widely accepted as a mainstream language right now than Python – and this, besides that i like to code in Ruby much more, will keep me in the Ruby camp for a long-long time…