Live data from Hacker News

Can anyone explain why Ruby is so popular?

news.ycombinator.com

11–20 of 46 posts

Re: Can anyone explain why Ruby is so popular?

#11
post #4

Ruby is popular because of Rails. If you're not going to use Rails, I don't see much reason to learn Ruby as in my opinion Python is easier to learn and is applicable to so much more than Ruby. That said, I agree that the syntax did feel like a hybrid of Python and Perl (with a bit of crack mixed in) - but once I started playing around with it, I really started to appreciate the syntax.

Why do you say Python is applicable to so much more than Ruby? I don't see how this can possibly be true since they are both powerful scripting languages.

Re: Can anyone explain why Ruby is so popular?

#12

I personally love the syntax, and in my own experience is not that slow, I use it with Sinatra and my productivity is huge. I'm also a C# and Delphi developer. I learned Ruby cause I had the need the learn an scripting language, and the reason to not learn python was that it looks like it is stock for ever in the 2.7 version, so I chose Ruby and I'm very pleased with my decision.

+1for Sinatra!

Re: Can anyone explain why Ruby is so popular?

#13
post #5

I'm interested in the answers to these questions: 1. What does Rails do that Django doesn't? (Feel free to substitute any other Web framework for Django if you think it'll help your answer be more illustrative.) 2. Why hasn't the Python community seen whatever Ruby's doing and copied whatever makes Ruby popular? Are there any Python/Ruby experts reading this who are willing to port or reimplement the good parts of Ru…

For #1 everything I've seen points to rails and Django having a nearly 1 to 1 correspondence. It's just preference for the most part.

Re: Can anyone explain why Ruby is so popular?

#14
post #11
post #4

Ruby is popular because of Rails. If you're not going to use Rails, I don't see much reason to learn Ruby as in my opinion Python is easier to learn and is applicable to so much more than Ruby. That said, I agree that the syntax did feel like a hybrid of Python and Perl (with a bit of crack mixed in) - but once I started playing around with it, I really started to appreciate the syntax.

Why do you say Python is applicable to so much more than Ruby? I don't see how this can possibly be true since they are both powerful scripting languages.

It depends on your field, I guess. Scientific computing for example uses a lot of Python. Ditto for the geospatial field where both the proprietary packages and the open source ones use Python. Sometimes, it's not the language's power that matters but the field of application and the existing libraries and community.

Re: Can anyone explain why Ruby is so popular?

#15
post #11
post #4

Ruby is popular because of Rails. If you're not going to use Rails, I don't see much reason to learn Ruby as in my opinion Python is easier to learn and is applicable to so much more than Ruby. That said, I agree that the syntax did feel like a hybrid of Python and Perl (with a bit of crack mixed in) - but once I started playing around with it, I really started to appreciate the syntax.

Why do you say Python is applicable to so much more than Ruby? I don't see how this can possibly be true since they are both powerful scripting languages.

They are both powerful scripting languages, but I think the ruby community suffers from a monoculture around rails & web development. Python also has a strong emphasis on web development (django, flask, pyramid), but there are also large communities of people doing scientific / numeric computing (scipy, numpy), bioinformatics (biopython), games (pygame, pyglet), networking (twisted), education (MIT's 6.00 course), embedded stuff / robotics, etc.

Re: Can anyone explain why Ruby is so popular?

#16
post #11
post #4

Ruby is popular because of Rails. If you're not going to use Rails, I don't see much reason to learn Ruby as in my opinion Python is easier to learn and is applicable to so much more than Ruby. That said, I agree that the syntax did feel like a hybrid of Python and Perl (with a bit of crack mixed in) - but once I started playing around with it, I really started to appreciate the syntax.

Why do you say Python is applicable to so much more than Ruby? I don't see how this can possibly be true since they are both powerful scripting languages.

Python is much more complete when it comes to math and science.

Re: Can anyone explain why Ruby is so popular?

#17
"I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language." -Matz

Ruby and its ecosystem revolves around your happiness and productivity. Isn't that great?

Re: Can anyone explain why Ruby is so popular?

#18
post #10
post #5

I'm interested in the answers to these questions: 1. What does Rails do that Django doesn't? (Feel free to substitute any other Web framework for Django if you think it'll help your answer be more illustrative.) 2. Why hasn't the Python community seen whatever Ruby's doing and copied whatever makes Ruby popular? Are there any Python/Ruby experts reading this who are willing to port or reimplement the good parts of Ru…

I don't know about the first question, but: 2) Because Python would become Ruby, or at least Pubython, then. What attracts most people to Ruby is its humanist syntax, not sure what Pythons guiding philosophy behind the syntax is, but I tried both and ruby was just a lot better. 3) There is loads of little things that are just personal preference for me, but the choice of language always boils down to personal prefere…

> Pythons guiding philosophy behind the syntax

Python's syntax philosophy in a nutshell: The more your program looks like line noise, the harder it is to read. Operators should be simple and minimal, operations like list comprehension should match existing usage in English, mathematics, or C.

> ruby was just a lot better

Here's a Ruby snippet. I don't want to pick on this particular project [1], rather, I've found that this is typical of Ruby code:

  state_machine :state, initial: :active do
    after_transition any => :blocked do |user, transition|
      # Remove user from all projects and
      user.users_projects.find_each do |membership|
        return false unless membership.destroy
      end
    end
Wow. There are colons, absolute value bars, implications, and who-knows-what-else flying everywhere! It gets worse, elsewhere in the same file there are messy lines like this one with single-arrow implications, question marks and ampersands [2]:

  scope :not_in_project, ->(project) { project.users.present? ? where("id not in (:ids)", ids: project.users.map(&:id) ) : scoped }
Simple, intuitive syntax? From where I sit, the syntax of Ruby is worse than C++, and approaches Perl levels of awfulness.

In most languages, I can at least sort-of grok what's going on from the context when I see unfamiliar operators, but not so in Ruby.

[1] https://github.com/gitlabhq/gitlabhq/blob/4caaea824cf51670d1...

[2] https://github.com/gitlabhq/gitlabhq/blob/4caaea824cf51670d1...

Re: Can anyone explain why Ruby is so popular?

#19
post #9

I love Ruby's syntax. I tries Python, but I didn't like it as much as Ruby, what putt me off about python is the meaningful indentation (although I do not mind that in CoffeeScript). Also, Ruby itself is not slow, but CRuby (MRI, YARV, whatever you call it) is slow; Rubinius ("rbx") is a wonderful (and my personal favourite) alternative for MRI. In fact, I use rbx and EventMachine for a fun app that has a growing num…

Can you elaborate on what put you off Python's indentation?
Post reply on HN