Live data from Hacker News

Hello Ruby – Almost there

blog.helloruby.com

11–20 of 128 posts

Re: Hello Ruby – Almost there

#11
post #3

Looks great. Recently, I was trying to wrap my head around eigenclass inheritance mechanisms and it was pretty tough. Not to mention the object model, where classes are also objects and the Object - Module - Class relationship. I wouldn't recommend Ruby as a first language to anyone — it may look easy at first, but to grasp it, you need to invest much more time in future.

We are talking about a children's book, I don't think a reader of this book will have to maintain large codebases for a job anytime soon.

Incidentally, Ruby is great for beginners thanks to its expressiveness.

Re: Hello Ruby – Almost there

#12
post #3

Looks great. Recently, I was trying to wrap my head around eigenclass inheritance mechanisms and it was pretty tough. Not to mention the object model, where classes are also objects and the Object - Module - Class relationship. I wouldn't recommend Ruby as a first language to anyone — it may look easy at first, but to grasp it, you need to invest much more time in future.

Sometimes the bias you have from learning programming one way makes it more difficult to grasp concepts which are different. I recall a study[1] where they questioned whether recursion is more difficult than iteration if it is introduced first. Certainly recursion was difficult for me when I was first learning because I had done a lot of programming using iteration first. It seems surprising that it may have just been a bias of what was introduced first.

I think that eigenclasses are a good example of this. Just because of the languages I learned early on, eigenclasses were obvious to me. I had a hard time even understanding why they had a name: OO without eigenclasses was just another way of saying "broken OO" ;-) Again, it's a bias which is hard to be aware of.

[1] It may be this one: http://dl.acm.org/citation.cfm?id=2361296

Re: Hello Ruby – Almost there

#13

Cool. Would you translate into other languages? Having kids speaking Italian I would be interested ;-)

Cool. Would you translate into other languages? Having kids learning Haskell I would be interested ;-)

I probably would. I remember once I offered to translate a kickstarter project for baby girl engineers, so why not a book for baby programmers :-). Feel free to get in touch if needed.

Re: Hello Ruby – Almost there

#14
post #3

Looks great. Recently, I was trying to wrap my head around eigenclass inheritance mechanisms and it was pretty tough. Not to mention the object model, where classes are also objects and the Object - Module - Class relationship. I wouldn't recommend Ruby as a first language to anyone — it may look easy at first, but to grasp it, you need to invest much more time in future.

These are advanced subjects and even a proficient programmer doesn't need those very often.

The advantages of Ruby as a first language IMO are that it is a pure OO language. No special cases, no unnecessary boilerplate. Much better than Java in that regard. But you could argue if nowadays you still need to focus that much on OO.

I'll be interested on the book turns out. Usually, I wouldn't recommend a generic programming language as a a first language for kids. I would use something with turtle graphics and a REPL.

Re: Hello Ruby – Almost there

#15
post #3

Looks great. Recently, I was trying to wrap my head around eigenclass inheritance mechanisms and it was pretty tough. Not to mention the object model, where classes are also objects and the Object - Module - Class relationship. I wouldn't recommend Ruby as a first language to anyone — it may look easy at first, but to grasp it, you need to invest much more time in future.

Sometimes the bias you have from learning programming one way makes it more difficult to grasp concepts which are different. I recall a study[1] where they questioned whether recursion is more difficult than iteration if it is introduced first. Certainly recursion was difficult for me when I was first learning because I had done a lot of programming using iteration first. It seems surprising that it may have just bee…

What troubles me the most with the iter/rec debate is that iteration is so trivial for most, but then many problems look intractable. Recursion feels awkwardly void, empty, almost nonsensical, but when you click your horizon broaden dramatically.

That said, I still fail to recognize recursive patterns far to often.

Re: Hello Ruby – Almost there

#16
post #3

Looks great. Recently, I was trying to wrap my head around eigenclass inheritance mechanisms and it was pretty tough. Not to mention the object model, where classes are also objects and the Object - Module - Class relationship. I wouldn't recommend Ruby as a first language to anyone — it may look easy at first, but to grasp it, you need to invest much more time in future.

I think, day-to-day, the Ruby object model can be as simple or as complex as you'd like it to be. Most dynamic or static OO languages have just as much complexity under the hood (vtables, doesNotUnderstand, metaclasses, etc). It has to be complete anyway, so it's made accessible, for better or worse.

I think you're more likely to run into it in the wild in Ruby because it's better exposed than most languages. When you see reflection or meta-object APIs in a lot of (typically not-as-dynamic) languages, it's sort of a "HOLY FUCK, WATCH OUT, I'M METAPROGRAMMING" flag. In Ruby, it's easier to daintily follow the white rabbit into the object model and care about the relationships you're referring to.

But on its surface level (class keyword vs. Class.new, def vs. define_method), I don't see it being any more complicated than similar dynamic languages.

When you say "puts 1+1" in a blank file, I can't imagine that not grasping that you're in a binding of an anonymous singleton instance of an Object named "main" being an hindrance. What's cool is, if you need to know, there's not a weird brick wall in your way.

Re: Hello Ruby – Almost there

#19
post #3

Looks great. Recently, I was trying to wrap my head around eigenclass inheritance mechanisms and it was pretty tough. Not to mention the object model, where classes are also objects and the Object - Module - Class relationship. I wouldn't recommend Ruby as a first language to anyone — it may look easy at first, but to grasp it, you need to invest much more time in future.

These are the advance features. You are not required to know how inheritance works (or what the Singleton is) to write runy code. You dont have to use OO design or anything. You can write procedural code in ruby if you want.

These advanced fratures are used mostly in metaprogramming.

Ruby is like the guitar: easy to learn, hard to master.

Re: Hello Ruby – Almost there

#20

Cool. Would you translate into other languages? Having kids speaking Italian I would be interested ;-)

Amazing book! I don't have kids :( but I would be more than happy to help for the italian translation

I have the same feeling, and would be more than happy to help with a brazilian portuguese translation (if the author is reading this, my email is on my profile o/)
Post reply on HN