

Ask HN: What makes Ruby so great? - f1gm3nt

Ok, I'm sick of reading articles where the writer says, "Ruby is awesome, you should use it." and ones that compare Ruby to C or some other language that isn't used for the same things.<p>Each language has it's pros and cons. It's unfair to compare apples and oranges. It's also unfair to to just say "it's awesome" and that you need to use it.<p>So what makes Ruby better than PHP? Python? Perl? All can be used for web programming (Which is what I'm talking about here). Which brings me to another point. Ruby on Rails, I had no idea that Rails was a framework at first. It's the same as using a framework for PHP (Symfony, Kohana, CakePHP, etc) or for Python or for Perl.<p>Please HN, why is Ruby so great? Ruby fans seem like Apple fans to me =\<p>Thank you.
======
jamesbritt
Spend a week learning it and see what you think. Play with the
metaprogramming, runtime code creation, and dynamic method invocation, and see
if it floats your boat.

(Try this article I wrote for DevX:
<http://www.devx.com/RubySpecialReport/Article/34502>

I tried to give an example that would show off some of the nicer things in
Ruby.)

After trying the language, if you don't like it, don't use it, and stop
reading Ruby articles.

BTW, anything that claims "Blub is so awesome, you should use it," but doesn't
explain why, isn't worth the time of day. Ignore them.

It's unfortunate that there are some people who gush over Ruby like it was
their first high school crush, but so what? Try a variety of languages, find
one or two that suit you, learn them well, and go make stuff.

Code talks, bullshit walks.

~~~
f1gm3nt
Thanks, you are very straight forward. I was assuming I would get a lot of
people flaming this because Ruby is like "their first high school crush", but
was wrong.

Do you have another link to your article? I'd like to read it, but the site
wants me to register. I'm not down with that.

Thanks James

~~~
jamesbritt
Re my other comment: Also ran into the odd sign-in required, so I decided to
just host the article myself:

[http://www.neurogami.com/articles/10_minutes_to_your_first_R...](http://www.neurogami.com/articles/10_minutes_to_your_first_Ruby_app/)

------
pedalpete
I'm with you on the Ruby fans seem like Apple fans.

Based on your comment about web programming, you are talking about Ruby on
Rails which is the web framework for the Ruby language.

I've just gone back to learning RoR after trying it a few years ago. I'm
normally a PHP programmer, but have been playing with some RoR with MongoDB
stuff.

My take on it coming from a regular LAMP is that RoR has lots of gems
(packages) that are easy to install and use.

The code generators get you up and running really quickly, though I'm not
actually a fan of most generators.

RoR applications have a rather specific structure. I think it is deeper than
MVC, as there are naming conventions for functions, variables/collections,
etc.

The structure is good because it is fairly easy to back-trace through somebody
else's code to see what they've done.

What I'm finding really challenging is that there are so many small details
that are hidden from the code.

For instance, in RoR, 'render' is like an include file, but you don't actually
have to type the name of the file or where it exists. Based on the naming
schemes and structure of RoR it gets the variable/collection and file name
because everything has the same name.

What I haven't found is a place where it explains what RoR is doing, so you
know that when you have an error, this is why.

I think we are just supposed to blindly follow the 'it just works' mantra,
which has never really worked for me with Apple, and I'm barely holding it
together with RoR.

As far as documentation goes, it is tough to beat PHP. The documentation is
really good, and the language/framework doesn't do the work for you, so you
build a page, put something into the db, get it out, put it on this page, call
it from that page, etc. You build your own structure so you know where things
are and how things work.

The tutorials I've seen keep going through the very same basic stuff of
getting RoR to build crud operations for you, or how to change a view. But
getting into the meat of RoR is proving to be much more difficult.

------
masnick
From the perspective of someone who is looking for a first programming
language or a language that is dead simple to use for basic tasks, I think
Ruby is a great choice.

I think this is primarily because the syntax can be very intuitive, especially
compared to something like perl. Ruby code is generally readable even to
someone who doesn't know Ruby (there are some exceptions of course, as Ruby
can be very terse in the right hands).

There are also a ridiculous number of gems that are easy to install and use.
Need to do document classification? There's a gem for that (classifier). Need
to access a database and want to do it through Ruby objects? There's a gem for
that (sequel).

~~~
chromatic
_Ruby code is generally readable even to someone who doesn't know Ruby...._

I hear this claim often about many languages. I'd like to see some sort of
proof, as well as some explanation of why that should matter.

~~~
jamesbritt
" ... as well as some explanation of why that should matter."

It doesn't.

I've heard the same thing, or some variation ("It's executable pseudo-code!"),
and thought it a useful indicator of some intangible but important goodness,
but it doesn't hold up.

Look at Haskell. (No, really, you won't go blind. ) Few people are going to
claim it's generally readable to the uninitiated, but so what? So is French,
for a lot of people. The thing is, if you think it would be useful, you learn
it, and at that point the value of "readable to people who haven't learned it"
goes to nil.

You could argue that some languages (maybe Haskell) maintain a level of
inscrutability for a long time as you are learning; you continue to spend too
much time decoding text when you could be zipping along with some reads-just-
like-English language.

But that's a different issue. "Difficult to obtain proficiency" is not the
same as "intelligible to outsiders", and concerns different value to the
programmer. Plus, the cost of proficiency needs to be weighed against the
return on effort. (Consider Vim or Emacs. Worth the effort to learn? An awful
lot of people seem to think so.)

It may take longer to become proficient in (say) Haskell than in Ruby, but the
long term payoff may be that you become far more efficient, with your code
being far more concise.

There's a difference between BASIC and Brainfuck, and some language
comparisons are just apples and oranges, but the value of being easy or
readable to newbies or outsiders is largely tied to the value of being a
newbie or an outsider. Once you are neither you really need your language to
have other strengths.

(Which certainly Ruby has, and its those strengths people should use to sell
it.)

------
fragmede
Rails.

Prior to Ruby on Rails, most people's exposure to web dev was PHP. Go from
doing PHP by hand for the simplest CRUD based pages, to the magic of Rails
that magically does half the work for the same page. That magic gained the
language not just converts, but fans on the level of Apple fans.

There are other choices these days, but thats where the fandom originates
from.

------
minalecs
Although Ruby is a very productive language, I think its more about the
community. Its moving incredibly fast, and the people in the community are
doing really awesome things right now. Resources for programmers are abundant.

------
toadytim
Ruby is toast, now that we have node.js you can do just about everything with
JavaScript alone.

