views:

826

answers:

15

NOTE: This is NOT flame bait. I'm generally curious, so please, don't start any wars!

Whenever I read a Ruby blog it goes something like:

I used to be a devout PHP or Perl developer until one day I decided to start using Ruby. Now I love it.

Considering that without Rails, Ruby would be just another obscure dynamic language, it makes me wonder why it seems to be the defacto standard for people starting out with dynamic languages.

Python seems more mature, faster, none of the memory leaking issues with its virtual machine, wider application coverage and a very clean syntax subset.

Ruby, on the other hand, is the opposite of all of these, and is technically more complex due to the meta-programming magic (that the Rails guys seem to love) that can change the langauge so significantly that it might as well be a different language in some cases.

Why then, do people seem to gravitate towards Ruby when Python is right there?

Some guesses:

  • They're web developers who've done nothing but PHP and Rails is the new hotness
  • Only Ruby programmers feel the need to blog about their shift from PHP/Perl to Ruby
  • They like the meta-programming aspects
  • There's a hardcore community around it that they want to be a part of
+10  A: 

Python developers don't want to admit starting with PHP? ;-)

Nick Presta
+5  A: 

Two words: good marketing.

musicfreak
...Its the Apple of developer languages. Come to think of it, every single Ruby programmer I've ever met is a macbook-carrying hipster type.
Soviut
My experience here matches Soviut's - people who follow trends tend to make a habit of it.
TML
Or it could be that the "slick, sexy and artistic" qualities that make Mac lovers Mac lovers also apply to slick, sexy and artistic languages like Ruby. :) It's a personal taste thing.
jess
I would hardly call Ruby slick, sexy or artistic. Syntactically, it feels a lot like python without whitespace sensitivity. Getting beyond that, Ruby's libraries seem lacking, and those that are any good make up for it using over zealous use of meta-programming magic.
Soviut
I think Ruby is pretty slick and sexy. I first learned it because of its extremely close ties to Smalltalk and slightly less close ties to Lisp. It can do a lot of cool stuff. A lot of that stuff obviously doesn't appeal to you, and that's all right — some people like Ruby, others like Fortran or whatever. But yes, Ruby appeals to me intellectually and esthetically, and I have more fun in it. (And yes, I use a Mac too. I've used Macs since 1984. I'm not sure if that's trendy.)
Chuck
I'll just mention here that I have not touched a Mac since the original (1984?). I have, however been a happy Ruby user since before Rails was a twinkle in DHH's eye. I get paid (handsomely) to work on Windows so that's where I run my Ruby. I may be missing out but you don't miss what you never had... ;-)
Mike Woodhouse
@Soviut: And don't even get me started on the library "documentation" for Ruby... then take a look at the rich, lively tomes included with Python. Magic.
Wayne Koorts
Rejecting tools as "trendy" is being just as much of a Lemming.
Jason Watkins
@Chuck See, Python has those exact same ties to smalltalk, and subsequently ABC. So those factors essentially cancel each other out.
Soviut
Python is not that closely related to Smalltalk. Ruby can pretty well be viewed as Smalltalk with an Algol syntax and without the weird image thing. For example, lambdas in Python are nowhere near as central to the language as they as in Ruby and Smalltalk, where they are the primary flow control feature.
Chuck
+16  A: 

As somebody who's recently become a Ruby fan instead of a Python fan (I tried both out), I can tell you first-hand: Ruby is more fun. The functional style and using "blocks" are actually very appealing to some people. Also, that "meta programming magic" stuff is really fun for some of us. I think Ruby also appeals to the (mostly displaced) old Perl crowd. It's very similar in its artistic, free and almost surreal approach.

I am not some web developer who's only used php - honestly I've hardly ever used php, and my first language was C (good 'ol K&R). I think it's just a personal choice. I think Ruby is very "right brained" in its appeal. I'd like to learn Python, too, because it's so widely used and a good, solid language... but Ruby is still just plain FUN to use.

Honestly, why does anybody pick any language? Why use C# over C++ or Java? They're all OO and have extensive libraries/resources, right? Why use Python over Perl (Python was just some obscure, rarely used language when I first started using Perl, after all). I could go on and on...

jess
I agree with you, but that's not why 90% of Rubyists joined the Ruby community. (I'm specifically thinking of the Rails community.)
musicfreak
I have to say, the Ruby/Rails community is also awesome. Once you learn where to look, there's endless resources and interesting people.
jess
@jess: Well, that's your opinion. I'll keep my thoughts about the Rails community to myself. :)
musicfreak
@Jess, its funny because I actually based my question on your blog post, haha. It was the tipping point anyways.
Soviut
Many of the language/platform choices you talked about have clear cut reasons for one over the other. Java for multi-platform, C# for LINQ, generics, etc. C++ for raw speed. The thing about Python is its used everywhere, Ruby has only one real application...Rails. Maybe the draw isn't the language itself, maybe its the Rails framework.
Soviut
@Soviut, ok, that is rather humorous. I just started that blog a few days ago... I didn't think anybody actually *read* it yet! I'll have to make the next post on python, just to balance things out.
jess
Also, I don't really see rails as the only application for Ruby. It's very popular, yes, but I've seen a lot of people use Ruby for developing DSLs, doing AI, and other projects of that nature. Its functional nature and block structure really lend it to those sorts of tasks. Also, look at some of the things _Why has written, like Shoes, which is very young, but looks to have a lot of potential.
jess
+2  A: 

My impression is that the Python culture is less oriented to emphatic public communication, so you tend to hear more about Ruby than you do about Python in many contexts. Whether this applies to "dynamic language newbies" directly (since they're presumably not yet very aligned to either culture) is less clear.

Alex Martelli
+4  A: 

Speaking as a python fan, I think if I were a perl developer and switched to ruby, I'd love it too :-)

John Fouhy
I realized that just about anything is a step up from Perl or PHP, but I find Python's syntax cleaner and Ruby's meta-programming starts feeling like an homage to Perl syntax complexity.
Soviut
@Soviut: Putting Perl and PHP in the same bucket is just...wrong. On quite a few levels. :-P (Okay, I'm biased, I love coding in Perl, Ruby, and Python, but I loathe coding in PHP.)
Chris Jester-Young
+11  A: 

Internet chatter:

There seemed to be an explosion of Ruby newbies when Rails became popular. We saw the same thing when Twitter and 37 Signals came out.

A couple years ago, when it was announced that Python was being used at Google and Youtube, the same thing happened. And the same thing happened when Django came out.

Unknown
+4  A: 

I was inspired to learn Ruby after reading Why's Poignant Guide.

I mean, come on.. CARTOON FOXES.

Bayard Randel
Chunky bacon!!! (really though, Why sort of embodies that whole "Ruby is the language for creative/artistic/right-brained types" thing)
jess
Something to note is that I'm an artist but find Ruby as a language to be less intuitive than Python. That said, I get the impression the Ruby community is more where the artistic merit comes from.
Soviut
+3  A: 

I think it's the "many frameworks" problem: the tyranny of choice. Although I like having options in terms of web frameworks, it may be difficult for newbies to decide on a framework in Python. On the other hand, anyone who goes to Ruby pretty much knows that Rails is the web framework.

Jason Baker
I agree. Only recently has Django seemed to lead the charge in being the "Rails on Python".
Soviut
Quite unfortunately, at that. It's a shame, since there's much better web frameworks available for python.
Aaron Gallagher
+2  A: 

Python is pragmatic.

Ruby is pure.

Justice
I'm hoping there's sarcasm in there. hehe.
Soviut
I'm not sure about "pure". "expressive" might be more accurate.
Burke
I thought python was the pure one; judging from the Zen of Python (import this!). Then again, I don't know Ruby.
hasen j
@hasen: ???? "...Although practicality beats purity...". Maybe that "pure" isn't the right word for "there should be only one obvious way to do it". Besides, the "we're all grown adults" philosophy is the opposite of pure. It's a (good!) mix between purity and pragmatism.
Virgil Dupras
Don't know if this is intended to be sarcasm, but both languages explicitly state the exact opposite values: python with the one way to do things, ruby with the principle of least surprise.
Jason Watkins
+6  A: 

For me personally it was the community. I learned Ruby back around 2001 for some simple scripting tasks, and met up with the local users group. I found them very interesting to talk with, as most had wide experience with many languages and were pragmatic sorts. Ex smalltalk hackers were definitely the core of the early Ruby community.

Rails has brought a lot of attention to Ruby, and to some extent diluted some of the values that the community was formed around originally such as MINSWAN.

But Rails has also brought many smart people into the Ruby community to contribute. I'd argue that the Ruby community is doing some of the most interesting stuff in the OSS world, such as Github.

The thing I most often miss when dealing with other languages is how Ruby developers highly value elegance and simplicity. You see this not just in the code but in the websites, blogs, etc. They certainly aren't the only ones, but on the average, I find getting rolling with a new ruby library a smooth process. Websites tend to be well targeted with succinct documentation and useful examples. Where's the equivalents to Peepcode? Railscasts?

Ruby as a community knows how to market very well. Many say this with a derogatory slant, jumping on the backlash bandwagon against the hype and certain rockstar egos. That has its place, but they're also missing the huge advantages of a community that knows how to communicate in ways that are clear as well as entertaining. Developers find Ruby to be a sanctuary against some of the more soul sucking aspects of being in the software business.

Ruby is fun, and surprisingly, people discover fun matters.

Jason Watkins
I definitely agree about the elegance and simplicity.
mooware
+7  A: 

I am not convinced "dynamic language newbies" (whatever that means) are defaulting to Ruby over Python. If they are, there are several good reasons, not least of which is that Ruby is more dynamic than Python.

If someone is truly a newbie to dynamic languages, though, I think it is more likely that they will find Python before they find Ruby (because Python is more established), and that Python will be more easily grokkable than Ruby (because Python is a smaller step from typical nondynamic languages like C or Java). Ruby is probably more appealing to Perlers and Lispers, but if you already know Perl or Lisp, I wouldn't consider you new to dynamic languages.

(If Perl is not a dynamic language, someone should clear up what exactly is meant by "dynamic language". For that matter, Wikipedia considers PHP dynamic also.)

John Y
Yes, its true my example of dynamic languages weren't exactly air tight. I was using those more as languages people often stem from before getting in to python or ruby.
Soviut
A: 

I suspect Ruby has higher visibility than Python due primarily to Rails. So does google trends.

bendin
+4  A: 

I don't see how this not flame bait, you obviously dislike Ruby and want to complain about it. Isn't this a place to ask some real questions?

railsninja
+2  A: 

For me it's just a matter of taste. I know this will downvoted as help but this "magic" incarnation init or the like look plain ugly to me. Of course I use indentation for my code but I dislike beeing forced using it. What bothers me terribly is that I have to write def whatever(self)

Hell what else should it be at the first positon in an object oriented languages? This assignments self. whatever is another distate for me. But if I'd just the choice between Perl and Python I surely knew what I'd choose. But now I have Ruby and that's what I simply like. I'm even considereing wether I'd like Smalltalk more than Ruby and believe it or not I found something even more appealing as Ruby to me. That's io http://www.iolanguage.com/

I've looked into it and just find it fantastic. But I'm still using Ruby because of Rails and JRuby and whatever. What I especially like about Io even more than in Ruby is the nice interfacing to C. In my stupid opinion. the order is probably Ruby,Python, Io, Tcl/Tk in this regard I'M undecided in both... But definitly the C code is extremly clean in Io.

Yes I know it's a matter of taste and anybody can disagree with me about it, but that's what's so nice of having a choice. You can pick what you prefer....

Friedrich
+3  A: 

I absolutely disagree with your claim that Ruby is the default. If you look at language statistics like the TIOBE index or Ohloh the results are quite contrary. Overall Python has much more momentum.

nikow