Hacker News new | comments | ask | show | jobs | submit login
Ask HN: Why do so many people hate Ruby?
28 points by eric970 on Feb 2, 2013 | hide | past | web | favorite | 35 comments
I've been a Ruby dev and a Rails dev for about two years now. I've always found the former to be an enjoyable, elegant language to write in, and the later to be a wonderful framework that makes use of some great patterns and gems. I'm not only a Ruby and Rails dev; I also enjoy programming in JS and I've been teaching myself Python as well.

Lately, especially after these security vulnerabilities became public, I've seen a lot of hate directed towards both the Ruby and the Rails community.

I'm curious as to why this is, and I'd like to get HN's input on this. The Ruby community has a lot of drama from time to time, but that's the only reason I can think of. Where is the hate coming from of people who say everybody should just throw out Ruby, stop using Rails, etc.?

To me the biggest annoyance about the Ruby community is the belief that they invented everything and know how to do everything right if others would just listen.

And then, through unfamiliarity with what others learned a long time ago, they do it wrong.

As a random example, unit testing has been the standard for perl (note capitalization - I'm referring to the interpreter here) since it was released in the mid-80s, and for the Perl community since CPAN was created in the mid-90s. And when I say standard I don't mean that someone writes tests, runs it, then packages. I mean that - by default - nothing gets installed anywhere until it has passed its full test suite. Furthermore if I release a module to CPAN, I'll get automated emails about every OS and version of Perl that it didn't work on.

Core ruby still does not have good unit tests, and you have to go out of your way to run unit tests for gems. If you do that, you will find that a good portion were only set up for the author to run - they didn't think anyone else would ever do that.

And yet I've had Ruby devs with a straight face trying to tell me that Ruby is awesome for its testing culture, and everyone else has a lot to learn from them.

They are missing a lot, and don't realize it.

Could it be that Rails (and by extension Ruby) is the first really popular post-web-revolution language used for development since PHP, and, unburdened by lots of bad practices having evolved alongside (not necessarily because of) PHP, re-introduces a whole bunch of good practices like unit testing?

And could it be that as a result young, excited and still green developers, comparing themselves to the 'bad' previous web generation, get a bit cocky about it?

These are not rhetorical questions; I'm actually asking this. I came from humble hack-together-crazy-bad-php-apps, went through getting used to more frameworky stuff with Drupal, and then ended up at Rails with a certain comfort and a definite increase in best-practice. My first introduction to unit testing was through Hartl's tutorials, perhaps because I have no formal programming background. I could see how some people after a similar process get cocky about how great they are because they write tests.

I'm not defending cockiness or whatever characterizes the Ruby community. I'm just wondering.

People who come to a better environment from a worse one often do get "true religion", and I am sure that happened to a lot of Ruby devs.

You cite PHP. I would also cite Java devs whose first dynamic language was Ruby, and then went overboard.

Either way, enthusiasm combined with lack of perspective leads to annoyance for people who have that perspective, who realize that you're still missing some basic lessons. (Monkeypatching anyone?)

Ah, great observation. That really does explain it. It's not unlike the zeal of just-reborn Christians, or even just-'deconversed' nonbelievers.

That's the attitude which annoys me, as someone who first used Ruby in 2000 and had been doing web programming since 1998. Neither Ruby nor Rails invented a lot of things, nor did it perfect them.

(Rails does deserve credit for promoting "convention over configuration" as a design concept, but plenty of us were doing similar things years earlier.)

I used to code in Ruby before Rails existed and I switched back to Python because they had addressed a lot of the problems with object-oriented and functional programming that made me look for something else. And then there was this wave of arrogance when Rails popped up and it seemed that lots of people with little standard of comparisons made outrageous claims about Ruby. Rails and the Ruby community borrowed a lot of work from Python and other communities but claimed that it was "invented here" and did not give credit to those upon whose shoulders they were standing.

Ruby is overrated. Python is in most ways Ruby's equal, and in some ways a superior community. Groovy, on the JVM, with Grails can do the same sorts of things as Rails and gives access to the whole JVM ecosystem of libraries that is far larger than the GEMs collection. Scala is an important language that more people should use because it guides a developer towards writing cleaner code and using architectural patterns that lead to much more maintainable code.

That said, I would rather see people build things with Ruby rather than with Java or C++, so I am not one of those who would throw Ruby out entirely. If people decide to replace PERL with Ruby, I would applaud that action, even though I believe that Python is a better way to go.

But due to the negative factors in the Ruby community I would not advise anyone to learn Ruby as their first language because of the great risk of becoming a first-language fanboy. Better to start with something else, even PERL, C++ or Java, so that they have some perspective on programming languages.

> But due to the negative factors in the Ruby community I would not advise anyone to learn Ruby as their first language because of the great risk of becoming a first-language fanboy.

Perhaps that danger is very situational. In my surroundings Rails/Ruby is not the hottest thing anymore, but we work with it for generally well-considered reasons. I was introduced to Rails at this company, and never had any illusions of it being the end-all of frameworks and Ruby that of languages, as none of my 'mentor' coders at the company did either.

But in my general surroundings I can definitely imagine high rates of fanboyism.

People don't hate ruby, people hate the ruby on rails community.

Personally I don't have any beef with them, but when I ask people about the RoR community I hear lots of douchebagery stories.

One of the most frequent is how cocky everyone in RoR feels towards other programmers in other languages and how "cool" their framework is and so on.

This started towards PHP programmers, then moved to Python(Django) and recently it's Node.js who's getting lots of flames from them.

So yeah..

This. I think in all the years of talking to folks in the rails community, only 2 people were decent. Literally hundreds of arrogant assholes otherwise.

Fascinating. May I ask where you operate?

Reason I'm asking is that my main client works with Rails, but it's a big and rather old-world company where this choice was shockingly 'modern'. There's little to none off this sentiment you describe though. Rails was a pragmatic choice, so we use it.

All this was in the Bay Area

+1 to this.

Ruby itself is a great language, and that's what it is at the end of the day - it's just a language. What matters more is the community gather under it. As with any community, there are members that tend to be immature and arrogant which may reflect to anyone as a representation of the entire Ruby community as whole. Worse comes to worst, these "few members" can affect the culture of the community especially for new users of the language, turning the community and the language somewhat "cultish".

It sucks to think that an entire community gets the reputation of a group of assholes. I use Ruby and rails quite frequently and have definitely run into these type of people, but I've also been helped by seemingly great people more times than not.

My problem is that every RoR developer I've met is like this. Many also also seem to be more in the design field than actual developers.

I'm sorry that the community has treated you like this. I guarantee we're not all like this.

Maybe they're all trying to call on their inner DHH, or maybe they're really just assholes in real life, either way it sucks. Were these people you've actually met or were they online?

Prof Patterson/Fox, are you listening ?

From what I've seen, people are angry at a certain subset of the Ruby on Rails community, but then they take that anger and generalize it to the Rails community or even the Ruby community as a whole.

You really can't hate a language (well, I do have a complex relationship with PHP). What people hate are stereotypes built around communities. Usually from the conduct of some individuals. Every community has them. I mean, even the COBOL guys must roll their eyes anytime someone writes some douche comment about the language.

Don't pay attention to them. There are many nice people in the Ruby community. People who are there for the code, and not the drama.

Now, don't get me started about those Visual Basic guys... :)

I think you can hate a language.. you can hate it because you hate yourself, for the things the language make you do.

Coming from a Java background, I used to bang my head on the desk everything I had to write a boilerplate code for anonymous functions/classes.. luckily, there was Intellij IDE to ease the pain.

You don't hate Java. You hate the decisions that ultimately led you to working with it. :)


Like many of the comments have already mentioned, people in the Ruby on Rails community are arrogant. They think they are doing things in the right way.

The syntax. Python's syntax is much cleaner.

I tried to find examples of Ruby's awful syntax in tutorials, but much to my surprise, the code in the introductory sections of a couple tutorials picked at random looks clean and the language seems nearly Pythonic. Contrast that with a function from an actual Ruby on Rails project [1]:

    def fresh_commits(repo, n = 10)
      commits = repo.heads.map do |h|
        repo.commits(h.name, n).map { |c| Commit.new(c, h) }
      end.flatten.uniq { |c| c.id }

      commits.sort! do |x, y|
        y.committed_date <=> x.committed_date

Whoa! This code apparently calculates factorials (with the ! operator), absolute values (of course |x, y| looks like the length of a vector), and biconditionals (to someone with a math background, a <=> b means a => b and b => a). The function ends with an expression on the last line that doesn't look like it would have side-effects. WTF? There are question marks and colons in weird places in that file, too. I started to translate the function into Python, to show you how much cleaner it would be, but I simply couldn't follow what the multiple nested map's and uniq is supposed to do. I'm certain that the Python equivalent would be much easier to follow. (Even if you take "equivalent" to mean "list comprehension" or "itertools.map" instead of the most readable alternative, nested-for-loops.)

I don't think this project is particularly good or bad. I merely picked a random piece of Ruby code from an app I installed recently, and I feel the difficulties I had with the syntax of this function are representative of my struggles with Ruby as a whole.

All the strange symbols make Ruby code very hard to read. For me, the effort required to learn a language is directly related to the number of operator symbols it contains. Ruby is nearly as bad as Perl or shell scripts. (The operators-are-bad penalty to my impression of a language is reduced if same operator exists in other languages I already know well, like Python, C, C++, or standard mathematical notation.)

In Python, by contrast, you can usually get a fairly good idea of what syntactical constructs do without consulting the manual, even if you're unfamiliar with them. (To be fair, lambda is an exception.)

[1] https://github.com/gitlabhq/gitlabhq/blob/5a214ee6f198a90f41...

I understand you.. this Ruby code is unclear.

There is a lot of bad code out there, but you shouldn't judge Ruby by a random code snippet- Ruby is just the tool, and the developer is responsible to write clean code.

I don't know what the code is trying to do with all the nested mapping.. it seems like the first 2 lines break encapsulation of the Repo model, trying to gather all the commits. This is unrelated to Ruby, it's a "bad" OO design (might be wrong, I didn't read the rest of the code)

So lets ignore that, and just rewrite from line 3 and below:

    def fresh_commits(repo, n = 10)
      commits = repo.heads.map do |h|
        repo.commits(h.name, n).map { |c| Commit.new(c, h) }


Do you agree that the last line is clean & readable, even if you don't know "exactly" what "&:function_name" does?

I see more arrogance here than I ever have in the Ruby community, to be honest.

I guess all communities can't be as tolerant and high-minded as C++ and the level headed discussions I see going on in the Linux kernel mailing list.

> Why do so many people hate Ruby? Because they have sweated too hard to get a productive knowledge of their own favourite language with so much of "adapt your brain to the tool and remember how you did by heart" which in ruby never happens( it adapts to your human brain) and then they are turned off by the feeling of envy for this.

Nice example of RoR user blinders.

If you criticize what I say, then please bring arguments against what I said, i.e. bring me an example of a more Expressive, Flexible, Real world ready, community supported programming language to code in... (except ruby derivatives) I'd love to learn it. Don't forget any points please, because this is what made ruby so popular and adopted... Oh and don't even start with "expressive is subjective" thing. We are talking about a language, not an abstract art painting.

My problem is with the premise of your argument; that being expressive and flexible are more desirable than other traits, and that having those traits make it somehow more applicable to 'real world' applications, whatever those are.

I've coded in Ruby. I've also coded in C, C++, C#, VB.Net, VB 1 through 6, JS, Java Smalltalk, Pascal, MASM, and more. Many on production systems or consumer software that was distributed to millions of people. Each language has its strengths and weaknesses.

There are many situations where Ruby is a great choice. Unfortunately it also gets used in situations where maybe it wasn't the best choice.

No language is the be-all end-all. You're always going to want to choose the 'least bad' option for any project and there are many factors to weigh and not all of them are technical. Personally I will probably never choose to start a new project in, or build a team around, Ruby again.

You are trying to logically 'mislead' the sense of the points I made.

I never said that expressiveness and flexibility _alone_ are the keys of Ruby adoption in real world use cases.

Doing so you made my comment sound as if I were totally ignoring a simple thing such as the fact that the primary characteristic of a programming language(or any other tool) that wants to solving a real world problem is its ability to solve a real world problem... That's a bit pathetic and arrogant from you.. So I can see some bias against Ruby in the first place.

So having explained that, let's say that Ruby can solve many real world problems and _on top of that_ adds expressiveness and flexibility which is something that so far no other language has achieved at that level, putting up a tool that _in its wholeness_ can serve to a lot of purposes in a nice way.

Of course, due to its performance, at the moment some scopes might be left out, but find me another language in the same performance window(so with the same 'possible purposes') that can retain the same expressiveness and flexibily! (flexibiliy also intended as flexibility of its expressiveness itself!) Given the same performance then, what is the 'least bad' option if not the one which also gives you this added value? Which also leads to more maintenability, and in the end (and above all), to more FUN.... ?

And just to make this clear, when Rubysts say things like "FUN", "LOVE", they don't mean it like "skateboarding" or loving something a-la fan'obsessed'boy. We mean it like intellectually engaging, without many of the off-puts that a constrained environment like a typical programming language usually involves PLUS the big (so big) "Hey!" factor that comes in when you look back at your code and you are just instantly amazed at how good you distilled and syntesized a concept in 3 lines of code that seem to talk back to you...

Wish all the "haters" had tried Ruby at least once for the simple sake of discovering something new, and I am not talking about trying new programming paradigms (Ruby didn't invent them as so many bloggers felt the need to make clear..) it's about how mentally refreshingly it feels to collaborate with "The Machine" to impress your ideas.. and while you read back your code sometimes it can give you that enthusiasm and thrills that might even make you look a bit arrogant, like the good old days when you discovered a musical instrument and you saw that after a while you were pulling good stuff out of it NATURALLY.

I've also done C, and felt in love with pointers :) but once you know them you want to go further and inject some more creativity in your project, and then pointers come back angry at you for you letting them alone, bugging your code here and there, and reminding you have to think C-ish and eating in all the creativiy you had in mind when that night you sat down at the pc full of crazy great new big ideas for your project...

Ruby doesn't do that, it doesn't want me to think in a pre-packed way, it doesn't eat my creativy.

It collaborates with it, and it's not only fun when you code it, but also when you look back at it.. it still shines as in that moment when you had that particular coding "englightenment".

If you think that creativity is all, try Ruby. Performance is just a matter of time and will come :)

And that's all :) Oh.. and smile :) Arrogantly sometimes! :)

Is there an objective way to measure the flexibility and expressiveness of programming languages?

No, not "objective", because languages fill different roles, and it is the language's role that determines its "flexibility and expressiveness" for that specific purpose. This means comparisons cannot be based on shared criteria.

Excuse me, what do you think it is the role of a programming language usually ?

Is there a way to measure the flexibility and expressiveness of a language?

You tell me. You're the one saying that some languages are more flexible and expressive than others. How do you measure that?

How do you measure wheter what you just typed is more expressive to me than raw ascii numbers representing the characters you typed? ...

Why do you need to make a small problem big, just to sound "academic" ?

..you can easily measure the expressiveness of any given language by how easily you can understand it based on what you already know (i.e. your mothertongue language).

The same old principle of the least surpise..

And flexibility ? How would you tell if one language is more flexible than another ? It takes no academic graduation to understand that flexibilty is the degree of freedom the language allows you in combining the language fundamental "bits" in syntactically correct ways.

So, getting back on topic for you to understand better... :

Ruby different Ways To Loop http://www.ruby-forum.com/topic/151837

The beauty of Ruby through examples http://www.ruby-forum.com/topic/217762

Good reading.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact