Live data from Hacker News

Can anyone explain why Ruby is so popular?

news.ycombinator.com

31–40 of 46 posts

Re: Can anyone explain why Ruby is so popular?

#31
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…

You should give Python another chance. Here's why:

> meaningful indentation

Indentation in other languages has meaning too. If you have Java code, for example, that looks like this:

   public static boolean isIncreasing(int a[])
   {
      boolean result = true;
      for(int i=1;i
Can you spot the bug? The topic we're discussing is a huge hint as to what the bug is, but if the only clue you have is bad behavior in a longer program it can be much harder to spot. When skimming the code, the visual cue of the indentation is so strong that it's very easy for your brain to see what the programmer clearly intended to write rather than what's actually there. (The diagnosis of the above bug might be even hairier if the bug was introduced by inserting a "safe" print statement to help you debug an unrelated problem!)

Forcing your code's visual cues and behavior to match defeats an entire class of bugs. And even if you start out hating it, ultimately it's like the required semicolons in C/C++/Java: It's an annoyance at first, but after a while it becomes so automatic that you no longer stop to think about it.

Re: Can anyone explain why Ruby is so popular?

#32
post #29
post #25

Earlier quoted context omitted.

> 1. What does Rails do that Django doesn't? The answer is, basically, "Have a larger ecosystem without being Java." There are a few things each has by default that the other doesn't, but by and large I don't think people pick Rails because it has 8 million features and Django only has 7.95 million. > 2. Why hasn't the Python community seen whatever Ruby's doing and copied whatever makes Ruby popular? Are there any P…

> Python took a relatively long time to put out a comparable product. I don't remember if Django existed, but there certainly wasn't the situation you have today where Django is basically the "Python Rails" and they're seen as being on roughly equal footing. Instead, Pythonistas were all talking about how you should take Twisted and twelve other libraries and you just write all this glue code and then it's sort of li…

> Before I used Python, Java and C were my main languages. I was amazed at how short programs became in Python. For this reason, saying "Python loves explicitness" strikes me as strange, since it gets rid of braces, semicolons, variable declarations, the 'new' operator...

I think you have confused "explicitness" with "verbosity." Indentation is no less explicit than braces.

> I'm just a little surprised the momentum isn't swinging back to Python. Since IMHO Ruby's syntax makes the language...very undesirable

That is very much a YMMV sort of thing. A lot of people actually like the Ruby syntax because they find the greater flexibility and ability to define pseudo-DSLs to be pleasant.

Re: Can anyone explain why Ruby is so popular?

#33
post #31
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…

You should give Python another chance. Here's why: > meaningful indentation Indentation in other languages has meaning too. If you have Java code, for example, that looks like this: public static boolean isIncreasing(int a[]) { boolean result = true; for(int i=1;i Can you spot the bug? The topic we're discussing is a huge hint as to what the bug is, but if the only clue you have is bad behavior in a longer program it…

Sorry, but the "bug" is that someone doesn't know well the language's syntax and/or has spent too much time with braceless languages and tries to put as less braces as possible because of their personal preferences, resulting in a wrong block structure.

Maybe I'm just different than you, but I immediately notice the missing braces. Actually, the visual cues I look for (even when skimming the code) are the braces, not the indentation; especially, the missing closing brace at the end of the block alerts me. The indentation is a plus, an added redundancy.

Moral of the story: not everyone reads code the same way.

Re: Can anyone explain why Ruby is so popular?

#34
As designer who's learning to code, I find Ruby code more easy to learn and read. Other programs are too, let's say, cryptic syntax. And for the projects I am working for I don't need to work with another programming language.

If you let me chose, I would go all the way with Erlang or Go, but it's hard to learn for a non-coder.

Re: Can anyone explain why Ruby is so popular?

#36

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.

It's interesting that the two responses on here (yours included) so far mention that it was learned for scripting. The main reason I made the initial post is because I see it being used for much more than just scripting, ie. rails and ruby motion. It seems somewhat naive to use a scripting language in leui of a real language when coding something industrial. So I still am at a loss... Thank you for your comment, yeah…

Rails helps minimize time to market. Any sizeable Rails app that gets market traction is likely to have its hotspots revisited and broken out into services. The services need not use Ruby at all.

Edit: Ruby itself is just a language. If you're not building web apps or server scripts there's no particular reason to prefer it.

Re: Can anyone explain why Ruby is so popular?

#37
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.

>syntax did feel like a hybrid of Python and Perl (with a bit of crack mixed in)

My personal feeling is that it's mostly Smalltalk and Perl, and less Python, though technically wikipedia says it inherits from Python as well. I've coded Perl and Smalltalk though, but not ever really Python. Maybe if you look at it that way there's less crack mixed in.

Re: Can anyone explain why Ruby is so popular?

#38

I am a perl dev for almost 3 years and i learned it at my job after i tried ruby and python. For more than a year i felt i should have chosen ruby because of how intuitive it feels: you read the code always from left to right, whereas in perl you often either go from right to left or from the center of the line outward. Besides that, fuby also has that principle of less surprise. However, after I got accustomed with…

I know perl (among others) which I really like, but I feel like I have to learn python or ruby to be competitive.

Re: Can anyone explain why Ruby is so popular?

#40

Thanks for what? Sounds like your opinion is made up. Still trying to figure out if this is a question. I like Ruby about as much as PHP; I think it's more about what you build on the language or what framework you use.

Lol, I put in my true opinion and constantly get down voted. Seems like people would rather debate nonsensical things than face the truth. The original post deserved the response it got from me and I will continue to call it how I see it. If you want a real discussion then ask a real question. You didn't even say what you are trying to do. Web apps? Desktop programs? The op is trying to compare languages that are not even in the same domains. I like all the languages you listed and think they have their place. Not sure why you are comparing them to Ruby though.. I like Ruby mostly because of Rails but have been playing with laravel. PHP is faster sometimes but so is Ruby if you know how to program. Down vote me again haters. I'm starting to get off on it.
Post reply on HN