General Question

camertron's avatar

What's so special about Ruby, anyway?

Asked by camertron (2117points) November 13th, 2010

I remember researching Ruby (the programming language) for a class in college, but I remember it being really hard to find documentation for and a little difficult to read. I’d heard how people really love Ruby on Rails, but Ruby itself seemed like an archaic language with no real-world applications. What does Ruby have that other languages (Python, PHP, C++, Java, etc) don’t have? What’s makes it so special?

Observing members: 0 Composing members: 0

13 Answers

YARNLADY's avatar

According to the website, it has an elegance in it’s simplicity and productivity.

camertron's avatar

@YARNLADY every language claims to be elegant and simple. What’s different about Ruby?

Response moderated (Unhelpful)
HungryGuy's avatar

I never heard of Ruby. Are you doing web development? Although there are a number of web development languages like Java and Perl and Python, but PHP is pretty standard and easy to code in.

The most elegant language I know of, however, is Pascal, but it’s become pretty much a dead language these days.

Vortico's avatar

Ruby wouldn’t have any useful application if it wasn’t for Rails. The setup is similar to Python + Django with a few pros and cons. If you prefer Python, stick to that, but if you’d like to try something new, give it a shot. The idea-to-launch times are similar for web applications.

jrpowell's avatar

I use Ruby to screen scrape. nokogiri is a pretty wonderful gem. And Sinatra also kicks a bunch of ass. I’m sure there are alternatives for Python.

I don’t use Rails since I found the performance deplorable. That was years ago, maybe it is fixed now.

I like Ruby and use it for a lot of stuff. Mostly RubyCocoa apps for OS X.

I wouldn’t say it is better then Python. It is just what I learned first.

jrpowell's avatar

Vortico :: These languages do have uses outside of frameworks. Bittorrent was written in Python. I remember running python btheadless.py path/to/torrent lots of time. Thank god they made a GUI for it.

camertron's avatar

@Vortico and @johnpowell that’s all well and good, but what does Ruby have that other languages don’t? Any special language constructions that make it easier to use? Any particularly good syntax? Does it support an object-oriented mindset or is it purely procedural? Why?

jrpowell's avatar

@camertron :: I was just trying to say that there isn’t that much of a difference. People that say it is elegant or simple compared to other languages are blowing smoke up your ass.

I have been working on a app for about eight months using CodeIgniter. It is PHP and I prefer that over Rails or Django.

phaedryx's avatar

I don’t think that Ruby has anything that you can’t find in another language. Where I think it excels is that it has borrowed a lot of great ideas from other languages brought them together in a way that works well. From wikipedia:

“Ruby supports multiple programming paradigms, including functional, object-oriented, imperative and reflective.”

Yukihiro “Matz” Matsumoto, the creator of Ruby, wanted to create a programming language that “made programmers happy” and that “programmers would enjoy using”. If you are a programmer like Matz, you’ll find Ruby to be like a breath of fresh air. However, your mileage may vary.

Ruby is object-oriented; extremely so. Where other languages fudge a little, Ruby is uncompromising. For example, you can call methods on integers (-1.abs), nil (nil.to_s) and booleans ( false.kind_of?(FalseClass) ).

I don’t understand the “no documentation” thing. There are all kinds of books and websites around Ruby. There is even command line documentation (ri) if you like.

I find Ruby really easy to read, but, then again, your mileage may vary.

downtide's avatar

I have a friend whose daughter was able to program Ruby on Rails from the age of eight. I think that says a lot about it’s simplicity and ease of use.

phaedryx's avatar

I think Ruby done well can be very elegant and simple. Here’s where I’m going to disagree with @johnpowell. I’m currently writing some tests with rspec (a unit test framework written in Ruby). Here’s a made-up, but valid example:

@@describe Array do@@
    @@it “should be empty if it is a new Array” do@@
        @@Array.new.should be_empty@@
    @@end@@
@@end@@

…and I have a test for the Array class. I don’t think I could do anything like this in Java or PHP (judging by JUnit and PHPUnit).

phaedryx's avatar

ugh, ignore the @@ on all of those lines, sometimes I just can’t seem to work around fluther formatting, it looked great in the preview. Here’s what it should look like:

describe Array do
 it “should be empty if it is a new Array” do
  Array.new.should be_empty
 end
end

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther