Live data from Hacker News

New to Ruby? Tips for the new Rubyist.

jasimabasheer.com

61–65 of 65 posts

Re: New to Ruby? Tips for the new Rubyist.

#61
post #19

I'm in the middle of picking up Ruby primarily because there was a GitHub project I wanted to fork and modify for my purposes that happened to be written in Ruby.The biggest problem I found is that the Ruby (or maybe the Rails?) community by and large provides shit instructions on how to get something running. I checked out a handful of projects and they all said things like, "Just deploy the normal what you deploy a…

Michael Hartl's Rails Tutorial addresses this right away. The first chapter is called From Zero to Deploy, where he demonstrates how to set up a Ruby/Rails programming environment and deploy rails apps to Github and Heroku.

Link for Michael Hartl's Rails Tutorial: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

Available for free online, though you can also pay for it if you'd like.

Re: New to Ruby? Tips for the new Rubyist.

#62
post #34
post #28

Earlier quoted context omitted.

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 top…

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'…

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.

Re: New to Ruby? Tips for the new Rubyist.

#63
post #62
post #34

Earlier quoted context omitted.

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'…

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 f…

"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!"

Great analogy!

Re: New to Ruby? Tips for the new Rubyist.

#64
post #4

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.

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).

Re: New to Ruby? Tips for the new Rubyist.

#65
post #38

His summary of the object hierarchy of Ruby is probably more confusing than elucidating to most Ruby beginners, since he doesn't make it very clear that he's dealing with the distinction between instances and classes (which are themselves instances of Class). From the description it seems like he doesn't quite get the distinction himself, and one of the later examples is broken: "Array.new.methods - Object.methods" s…

> "Array.new.methods - Object.methods" should read "Array.new.methods - Object.new.methods". Otherwise he's in fact subtracting the methods available on an error instance from the methods available on an instance of Class, not the methods available on a generic object.. You are wrong, classes are objects :) 1.9.3p194 :084 > Object.new.methods - Object.methods => []

Actually, the author is inaccurate, comparing apples to oranges. Consider the opposite subtraction than you proposed:

    irb(0main):001:0> Object.methods - Object.new.methods
    => [:allocate, :new, ...]
That means doing "Array.new.methods - Object.methods" is subtracting things that may potentially be methods of an Array instance that should not be subtracted. It just so happens to work in this case because Array has none of those methods. But it doesn't work in the general case.

Consider for example, a "Person" class with a single instance method "name". In this case, "Person.new.methods - Object.methods" will not include "name", because this happens to be a method that applies both to Person instances and the object Object. The correct comparison is what vidarh said, "Array.new.methods - Object.new.methods".

The author's main point, however, was that you can write code like "Array.new.methods" and "Object.methods" at all, and that you can write code to subtract them. And this example shows that nicely.

Post reply on HN