News for hackers. Stuff that matters.

2 Questions about RoR

1. Can anyone recommend any good books on beginning Ruby on Rails? I have good general programming knowledge (I can do ASP/ASP.NET/PHP etc) but I've never used Ruby and I want to add it as another string to my bow.

2. How come RoR has taken off so much with startups? Admittedly I can only name Justin.tv and Twitter off the top of my head right now, but it seems to be the startup language of choice at the moment. Why is this?

( 27 comments | 10 points | on HN )
Re:2 Questions about RoR by craigbellot on Monday January 21, 2008 @10:30AM (#101582)
1. Agile Web Development with Rails

2. Because it's been designed by smart people who "get it" with regards to agile development, which is what startups need. In addition, the community has a "culture" which many startups identify with.

Re:2 Questions about RoR by fendale on Monday January 21, 2008 @10:50AM (#101593)
+1 for Agile Web development with Rails.

Getting the Programming Ruby 'Pickaxe' book for Ruby is good too.

Re:2 Questions about RoR by gregwebs on Tuesday January 22, 2008 @01:51AM (#102070)
This book is currently getting old- you may want to see if there is another book that has come out more recently that is just as good or better.
Re:2 Questions about RoR by vdm on Monday January 21, 2008 @11:24AM (#101607)
I just got 'The Rails Way' and my first impressions are that it is a definitive reference work (covering Rails 2 no less). I already prefer what I have seen to a lot of other Rails books I have gone through.

In particular I am not a fan of the Agile Web Development with Rails book; apart from anything else it is way behind the state of the art at this stage.

I actually like to learn from reference books; maybe its just me.

Re:2 Questions about RoR by raju on Monday January 21, 2008 @11:58AM (#101631)
I looked into 'The Rails Way' over the weekend. As vdm correctly says, its definitely a very comprehensive reference. And it makes as a good book, but you definitely need to work with a basic tutorial to get you up and running quickly. I would recommend "Agile Web Development with Rails" but with Rails 2.0 although its a little behind the curve, its not a bad book.

I am currently reading "Practical Social Networking Sites with Rails", and although its a decent book, the author tends to skip some of the most important details, leaving you wondering how something came about. I would not recommend it.

I have read 'Ruby for Rails', and its definitely a good book. David Black is a very good author and teaches you Ruby and shows you how a lot of the 'black-magic' in Rails happens.

Here is someone else's review of some of the books - http://antoniocangiano.com/rails-books/

For Ruby, I would recommend Peter Cooper's book over Programming Ruby any day... especially if you are new to Ruby and/or OOP in general.

Re:2 Questions about RoR by pius on Monday January 21, 2008 @11:18AM (#101604)
I'd highly recommend "Ruby For Rails" if you're learning Ruby and Rails at the same time.
Re:2 Questions about RoR by binarykeats on Monday January 21, 2008 @01:07PM (#101685)
Definitely. Learning the advanced features of Ruby will give you a big boost using Rails -- especially metaprogramming, which is something that few other frameworks employ.
Re:2 Questions about RoR by vdm on Monday January 21, 2008 @11:27AM (#101608)
+1
Re:2 Questions about RoR by carpal on Monday January 21, 2008 @10:53AM (#101594)
1) I've never gotten much utility out of Rails books. I've generally gotten much more use out of the API docs and blogs. That said, the Agile Web Development with Rails book is pretty much standard, and Rails Recipes is good for code examples. However, if you're doing something in Rails Recipes, there's probably a plugin for it by now.

2) Because it is very easy to implement an idea in a day and see if it sticks. More than that, when you're faced with a task that might not have much reward, it is easier to do if it doesn't feel like work. Programming in PHP/Java/C#/etc generally feels like work. Programming in Ruby generally feels like fun.

Re:2 Questions about RoR by wallflower on Monday January 21, 2008 @11:09AM (#101600)
"Programming in Ruby generally feels like fun" Thank you. That does it. I am going to buy a laptop (probably the Asus EEE, not the MacBook Air) and start learning Ruby on Rails code during my 53 minute train ride. I bought "The Rails Way" because Zed recommended it at the end of his rant, and it's pretty Greek to me. I'll start with beginningrails.com and the Pick-Axe book (Zed's criticism about it, aside)
Re:2 Questions about RoR by engtech on Monday January 21, 2008 @12:19PM (#101648)
And don't touch Ruby on Rails for Dummies with a 10ft pole. That book is horrible.

Here's my liveblogging take of my first three weeks with Rails:

http://internetducttape.com/category/ruby-on-rails/

Re:2 Questions about RoR by kevTheDev on Monday January 21, 2008 @12:31PM (#101658)
Hey,

Books are not always the easiest thing to learn from. I found screencasts to be an excellent way to pick up all sorts of stuff for Rails.

Check out peepcode.com, railscasts.com and showmedo.com for starters.

Some content is free (railscasts), others not so free.

Re:2 Questions about RoR by ROFISH on Monday January 21, 2008 @10:34AM (#101583)
1) I've used the Agile Ruby on Rails book along with the free Why's (Poignant) Guide to Ruby online. (Cartoon Foxes!) I suggest checking out Why's Guide first and learn Ruby before you hit Rails. Ruby's a fairly easy language to learn while Rails is a totally different programming scheme you may be unfamiliar with (ActiveRecord).

Look at CakePHP to get familiar with ActiveRecord for PHP. I don't really recommend CakePHP as a development platform, but it's a great way to understand Rails if Ruby+Rails at the same time is too complicated.

2) My opinion of why RoR has taken off is because ActiveRecord makes normal day-to-day activities simple. Verification is already handled. Although PHP and Ruby are roughly equal in speed (Ruby 2.0 is going to be a lot faster though!), Rails isn't. But once you're done, built-in caching features help it scale at least a little bit. Of course if you're worried about scalability, just program the whole thing in C. :P (That's what Amazon does!)

Re:2 Questions about RoR by whalesalad on Monday January 21, 2008 @07:09PM (#101901)
Justin.tv is alllll python. Not Ruby. Python baby.
Re:2 Questions about RoR by engtech on Monday January 21, 2008 @12:17PM (#101645)
Agile Web Development with Rails is a little too old now. I'd follow the other people and go with the Rails Way instead.

And don't bother with RESTful Web Services.. if you're using Rails 2.x then you only need a half page tutorial on how to use REST, not an entire book.

Re:2 Questions about RoR by motoko on Monday January 21, 2008 @03:47PM (#101799)
I like the RESTful Web Services book because it discussed how to design an API and why, not just the functions you'd need to wire an API together.
Re:2 Questions about RoR by vdm on Monday January 21, 2008 @03:50PM (#101803)
>don't bother with RESTful Web Services

I agree with you about AWDWR but I'm not so sure about this. RESTful Web Services is very good, and gives a much broader perspective about how & why REST works than you will get from just using Rails 2.

Re:2 Questions about RoR by raghus on Monday January 21, 2008 @10:57AM (#101596)
I strongly recommend Beginning Rails by Jeffrey Hardy. I liked it even more than AWDWR. Here's the companion site: http://beginningrails.com/. The author is active on the Google mailing list for this book as well.
Re:2 Questions about RoR by granderson on Tuesday January 22, 2008 @01:52AM (#102071)
1) I highly recommend Agile Web Development with Ruby on Rails. I also recommend the Pick Axe (Pragmatic Programmers Ruby book). I do not recommend Ruby for Rails. I bought it and skimmed it to realize I already knew everything in it after reading the other two.

2) B/c it has a great ORM layer (ActiveRecord) and strong ajax libraries (integration with prototype/script.aculo.us) which make it easy to quickly put together a very well organized app that has a lot of UI sizzle.

I also expect Merb to continue to gather steam, especially for people who "get" rails and who want to take it in specialized directions.

Re:2 Questions about RoR by mhartl on Monday January 21, 2008 @01:42PM (#101711)
Take a look at RailsSpace, which is an extended tutorial introduction to Rails. As one of the authors, I'm biased, but the Amazon reviews are pretty good: http://www.amazon.com/dp/0321480791

N.B. As with virtually all Rails books, it's a bit out of date (despite having only just come out last summer!), but we focus on general techniques that are plenty useful in Rails 2. I'm currently building a site with some of the same features as the book application, and I often find myself referring to the book for guidance.

Re:2 Questions about RoR by mattup on Monday January 21, 2008 @11:00AM (#101599)
1) Beginning Ruby by Peter Cooper is a good one for learning Ruby, the Pickaxe book is a great reference for Ruby as well. Agile Web development with Rails is good, also the Rails Way is good for Rails 2.0.
Re:2 Questions about RoR by jaaron on Monday January 21, 2008 @07:33PM (#101912)
1) RailsSpace by Hartl and The Rails Way by Fernandez are the best books out there right now.

2) Right time, right place. Rails came out around the same time the second wave of web startups picked up.

Also the argument is that Rails allows a smaller team (or even just one person) to write more functionality in less time. Whether that's true or not for you may vary.

Re:2 Questions about RoR by rob on Monday January 21, 2008 @10:47AM (#101592)
Just as an FYI, but I believe Justin.tv switched to Python.
Re:2 Questions about RoR by piers on Monday January 21, 2008 @11:13AM (#101602)
Actually I think you're right. Didn't they develop their own flash server with python?

But they started with RoR didn't they?

Re:2 Questions about RoR by nickb on Monday January 21, 2008 @01:26PM (#101696)
You're both semi-wrong. The website, justin.tv, is written in RoR and always was. Their flash server, PMS (Python Media Server), is written in Python. It was always in Python. PMS replaces the need to run Adobe's Flash server.
Re:2 Questions about RoR by emmett on Monday January 21, 2008 @02:51PM (#101762)
That's correct. Thanks for clearing that up!
Re:2 Questions about RoR by ajkirwin on Monday January 21, 2008 @02:45PM (#101757)
I'll have to check out some of these listed books, if only to have a reference around.

Like with PHP, ASP, Perl and others, I learned the language simply by looking at existing apps, hacking them up, then sitting down and making something of my own and all the fun trial and error that gives.

I find it a much nicer way to learn a language than from a book. But then, I'm a very hands-on person.