Ask HN: What makes Ruby so great?
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.
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.
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.
Please HN, why is Ruby so great? Ruby fans seem like Apple fans to me =\
Thank you.
12 comments
[ 3.1 ms ] story [ 26.8 ms ] thread(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.
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
Also, if you read it, let me know what you thought. Thanks!
http://www.neurogami.com/articles/10_minutes_to_your_first_R...
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).
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.
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.)
But Ruby is really GOOD fan fiction, only in software. You can tell Matz has been around the block, programming wise.
Over and over in Ruby there's a nice answer to a stupid problem some other language had.
Like you can tell the fanfic author read all the seminal works, you can tell Matz programmed in all the other annoying languages and said to himself MY language will address THIS bullshit!
Also - one wonderful thing about Ruby is over and over the answer to a problem is to do it SIMPLER. First time I've ever seen that in a language. You learn to have faith in it, as opposed to the other languages who seem determined to screw you and will only grudgingly do as you say if you absolutely, positively give them no other choice.
When they finally get the isomorphism figured out and map ruby onto the Smalltalk compiler and speed it up by a factor of 20, it will rule.
TLDR; It is teh awesome and chicks dig it.
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.
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.