I would like to get some advice from experienced Ruby hackers. Currently I am picking up Ruby through rails, which I am assuming is fairly common. I want to know the downsides to this and what people did to supplement their ruby knowledge beyond Rails. I eventually would like to write my own gems, contribute to open source, and so forth. I am absolutely not satisfied with just consuming Rails.
I'd highly recommend The Well Grounded Rubyist by David Black http://www.manning.com/black2/ if you want a good intro to Ruby, I found it a much better intro than the Pickaxe
I work with David and he is totally awesome. He's giving a talk at the NYC.rb meetup on June 12 called "The Well-Grounded Nuby" which is an intro tour to Ruby. Here's the meetup link. http://www.meetup.com/NYC-rb/events/57344932/
In fact, "The Well Grounded Rubyist" is a "reworking" of "Ruby for Rails". The author mentions this relationship between the books in his "about this book" section at the beginning of "The Well Grounded Rubyist".
I found Ruby for Rails very helpful when I was getting started. It helped separate Rails "magic" from the underlying language aspects in a way that most other books did not.
I can't recommend The Well-Grounded Rubyist higher myself and totally agree regarding it's accessibility in comparison to the Pickaxe. This is the book that taught me programming.
The best advice I can give is get to know Ruby well - don't just focus on Rails in the beginning. Eloquent Ruby by Russ Olsen is a great read and will give you a deeper understanding if you've got the basics down. Also, the PragProg book Metaprogramming in Ruby is a great intro to metaprogramming.
Really? Eloquent Ruby is one of the best Ruby books I've read - Russ Olsen is one of the best and most well respected technical writers out there. Design Patterns in Ruby is also excellent.
Agreed, Eloquent Ruby is a smashing book and I recommend it to all of my own Ruby students. I don't use it as an official textbook but I might as well do. Superb book.
I had this discussion already (see the link). Maybe it's a matter of taste but I think this book has some severe weaknesses and thus, I wouldn't recommend it.
No offence but perhaps you bought the wrong book? Eloquent Ruby is about style and design patterns, it's almost about the philosophy of Ruby code, best practises, aesthetics and the author's experiences.
Books like that are fundamentally about taste and style and technique; they can't really be "wrong". You might disagree with the author and think you have a superior approach but to say that randomly googling the topic led you to a "better" explanation tells me that perhaps you were looking at the wrong book in the first place.
Again the same discussion. I did not buy the wrong book. I knew exactly what I wanted
Don't get me wrong, your reply is kind of abstract and philosophical. I explained why this book just failed and should not be recommended (mainly the style and really, really awkward, wacky examples) and I face abstract replies. Sometimes I think these comments and Amazon reviews are all faked by SEO/Webspam people driving the book's sale (no offence, but because of guys like you recommending a totally weak book over and over without the slightest criticism I bought this crappy book and it's a really bad and frustrating experience). And again: I am not dumb or do not know what I wanted or bought (btw this is bad discussion style to implicitly question the buyer intent or skills, it was very indirect but still there).
Good grief, did you just accuse us all of being spambots?
Never mind that everyone here has been an HN member longer than you, but that is a very poor perspective to take. A rational person would note that a number of fairly successful programmers in their field are endorsing a book they had a bad opinion of and, at the least, go back and re-examine the foundations of that opinion. It's called humility and learning from those around you. But not you, oh no, you are absolutely right and everyone else is absolutely wrong and if they don't admit it they must be paid shills!
> Again the same discussion
The reason for that is that what you say is totally unconvincing, when it makes sense, which is not often. It is quite obvious, for example, that you bought the wrong kind of book, despite your inexplicable denials. You needed some kind of reference book or cookbook or something. You come across like this: "I bought Jamie Oliver's autobiography and it SUCKED! I needed a recipe for pancakes and I could find thousands on Google in seconds so why do I need that book!? That book is a stupid waste of money and anyone who says otherwise is a spammer! I did not buy the wrong book. I knew exactly what I wanted. I am not dumb"
> I am not dumb
The fact you feel the need to point this out doesn't speak well to how you come across in these discussions, does it?
You need to think about your attitude. Maybe instead of replying with some new inanity you should close the window, go outside, sit in the park or something, and think about some of the assumptions you are making when you cheerfully and thoughtlessly dismiss the advice and opinions of anyone who happens to disagree with yourself, especially the kind of talent who likes to hang out here. You might have an unpleasant realisation or two coming your way.
Spend a week just learning Ruby before doing anything with Rails. There's a huge learning curve to Rails - learning the language simultaneously will just make you frustrated.
Probably the biggest downside is that you'll incorrectly assume that some parts of Rails are actually part of Ruby. Then you'll miss them when they're not there and possibly feel a small amount of sadness. Oh the humanity! :)
The big one is ActiveSupport. There are many extensions to common Ruby objects like String, Enumerable, Hash, etc. For example. In Rails, you'll use something like this quite frequently:
some_string_var.parameterize
The parameterize method is part of ActiveSupport::Inflector. As you start to write Ruby outside of Rails, you'll come across occasions where you'd really like to use ActiveSupport methods like these, but fortunately, RubyGems and Bundler make that easy.
EDIT: My last paragraph isn't clear enough that you can use ActiveSupport outside of Rails by simply adding the gem to your Gemfile and requiring it in the relevant location. The downside is that you create a dependency. If you are writing ad hoc scripts, this can be an annoyance, but if you package all your scripts as a Gem using something like Thor, dependencies won't be a problem.
Thanks. I was expecting somebody to mention this. What I am currently doing is investigating most of the code I use, be it methods, classes, and so on. It takes me off of the main task, but I think based on what you experienced its a good thing. I have a folder for rails source code in my editor and I usually just hang out there. ;) Hopefully this will mitigate the problem.
I'd recommend reading Eloquent Ruby by Russ Olsen. It's a great after-Rails intro to Ruby and uses a lot of specific examples from the framework to highlight how Ruby features make some of the magic happen in Rails.
I came up the ranks like you, and actually abandoned Rails but stuck with Ruby for a while longer. I supplemented my Ruby skills the same way I do with most programming languages - I had an end-state in mind, and I coded towards it. In my case, this was a script and wrapper based around the MediaWiki API, but that doesn't matter. It just needs to be something doable. At that point, it's just a 10,000 hour play - code until you get it. I spend a lot of time with the docs open, but eventually that goes down, which is when you know you're getting it.
If you have a choice in framework, I'd actually recommend not learning Ruby through Rails. I'd learn it through Sinatra. Sinatra is a lightweight web framework (Rails is a heavyweight), and it has a lot less "magic", so it's more plain Ruby and less connecting framework components together.
Not knocking Rails, it's just that you'll get a really narrow and somewhat skewed perception of Ruby if you learn it through Rails (you'll have no way of easily separating the Rails magic from plain Ruby as you learn things).
I've also heard good things about the PragProg Ruby course - its $199 but is supposed to be excellent, though I have no direct personal experience with the course.