Live data from Hacker News

Hello Ruby – Almost there

blog.helloruby.com

71–80 of 128 posts

Re: Hello Ruby – Almost there

#71
post #70

Earlier quoted context omitted.

I learned to code at age 7 with QBasic, deconstructing Gorrilas in DOS, and later SmallTalk. Both languages are horrible, but were incredibly easy to learn. No one taught me, I played with them until I learned, and back then there was no internet. There are so many aspects of Ruby that make it well suited for teaching kids about programming that go WAY, WAY beyond the ridiculous observations you've made. You might as…

To me that appears to be the strangest way to express a loop in any language I've used (and I've used a lot of them). It also really bothers me that in ruby you can invoke a function on a null value to see if its null (myvar.nil?). That's really messed up...

> That's really messed up...

No, it's a brilliant use of polymorphism. "null" in Ruby is not a value, it's like everything else an object. So it have methods.

Just because you are not used to it doesn't make it messed up.

Re: Hello Ruby – Almost there

#72
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

Firstly, I think the project looks beautiful.

Personally, I just can't stand Ruby, so my opinion will not be balanced. I think the optional parenthesis will be terrible for a new programmer. I think the optional return statement will cause confusion in some cases. The absolute worst is the once or twice I've pasted code into the editor, and when run, I get a cryptic error. Using a hex editor, I discovered that some unicode whitespace got in there and was interpreted as a method or variable. wtf.

For my daughter, we started with Python (and bpython from the command line for explorability). She got caught up on classes, but I think that is natural. She is starting to look at javascript now and we will see how that goes. I think both of these are interesting first languages to learn (not without their warts for sure!). For my youngest, we started looking at Scratch from MIT.

Re: Hello Ruby – Almost there

#73
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

[deleted]

Re: Hello Ruby – Almost there

#74
post #38
post #22

I'm not sure whether Ruby is a good intro to programming. It doesn't have first-level functions, instead it has blocks (which can take parameters to serve the same use as functions but aren't). What would syntactically be a reference to a method in other languages instead invokes the method with no arguments. It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truc…

As someone who has taught several beginners (non-programmers) Ruby, I would say the uptake is good. Teaching at events like RailsGirls, I've had complete beginners start to "get it" and deploy their own websites using Rails and Heroku within a day. My personal experience has been that it makes a great first language, It's very natural to write, and easy to type. You start with super-short examples that are easily und…

> It's very natural to write, and easy to type. You start with super-short examples that are easily understood, using a bare-bones editor. Explaining blocks and iterators is a challenge of course.

Same can be said about Python, Swift, JavaScript, Lua, i.e. any high-level language polished and mature enough.

And an anecdote for you: my kids tried some of the above, they liked Lua most and Ruby least of all. Why? I guess the question is as complex as why some games are more popular than others, there is no clear explanation to these things really.

Re: Hello Ruby – Almost there

#75

Earlier quoted context omitted.

JS will probably mess up my kid's mind as much as ruby. My choices for intro programming language would probably be Haskell and Coffeescript - both has a simple but coherent set of concepts and a straightforward syntax designed around those concepts.

> Haskell seriously? I had a semi difficult time understanding FP a year and a half into my CS degree

I think Haskell -- and FP in general -- is probably easier as an intro to programming than it is for people to pick up after they've been conditioned by imperative programming.

Though I wouldn't use Haskell for kids; I don't think the tooling, resources, and compiler error messages are great for that.

Re: Hello Ruby – Almost there

#76
post #56
post #29

Earlier quoted context omitted.

Well ruby can be written in a very boring way if it's what you don't like : # nobody can say he doesn't understand that code , whatever language he is used to reducer = lambda {|res,val,array| return res+val} def reduce(array,reducer,initial) res=initial for i in 0...array.length res = reducer.call(res,array[i],array) end return res end reduce([1,2,4],reducer,0) # => 7 But there is no perfect language which is a good…

I actually found c# much easier to learn than Ruby. (I learned it before Ruby). The compiler helped a lot. It's also a lot more consistent. When I started Ruby, I often didn't understand why something I wrote worked. That's not a feeling I got very often from c#. That's just my experience. But I'd suggest c# is probably a better beginner's language. Especially paired with VS and an outstanding OOB debugging experienc…

> When I started Ruby, I often didn't understand why something I wrote worked.

Can you remember any examples? I can't think of very much in plain Ruby that's non-obvious.

Re: Hello Ruby – Almost there

#77
post #62

Earlier quoted context omitted.

The difference isn't the actual print operation; it's all the boilerplate that has to go around it. In Ruby, `puts "Hello World"` and you're done. The most you have to explain is puts and string literals. In C#, you have to create a class with a static main method. You're then left to choose between explaining classes and methods ("what's static? what's void?"), or skipping that and just treating them as the magic in…

You don't have to create a class with a static method if you use LinqPad which can run like a REPL. It can also pickup a file with that single line in it and execute it, so there is virtually no difference.

That's too many hoops for a child learning programming to jump through. There is a real difference in simplicity between Ruby and C#.

Re: Hello Ruby – Almost there

#78
post #35

What makes you think the book is ready? We've been told (KS backers) that the book isn't shipping until October 2015. There is absolutely nothing that you've linked to to indicate that it's ready. Incidentally the book costs less at retail, then even the lowest tier of it's Kickstarter campaign.

As another backer, I totally agree. This was one of the worst Kickstarter experiences of many mediocre to bad experiences. Projects like this are killing Kickstarter for me.

Re: Hello Ruby – Almost there

#79

The character's name is 'Ruby' but I don't expect the book itself to be any sort of introduction to ruby-the-language! I'm a backer — I expect the book might contain some Ruby code because it's pretty readable though I'm bothered either way. I am full expecting it'll be an engaging story to teach my kids some of the concepts of programming, which have nothing to do with any particular language.

Just to repeat and highlight this: THE BOOK ISN'T ABOUT TEACHING RUBY-THE-LANGUAGE I've yet to even find a mention of Ruby-the-language on the site.

Right. It teaches programming concepts with Ruby. It's not about learning Ruby the language.

Re: Hello Ruby – Almost there

#80
post #71
post #70

Earlier quoted context omitted.

To me that appears to be the strangest way to express a loop in any language I've used (and I've used a lot of them). It also really bothers me that in ruby you can invoke a function on a null value to see if its null (myvar.nil?). That's really messed up...

> That's really messed up... No, it's a brilliant use of polymorphism. "null" in Ruby is not a value, it's like everything else an object. So it have methods. Just because you are not used to it doesn't make it messed up.

It's the wrong way to think about organization of logic.

It's not a number's place to know how to do looping, it's not an object's place to know whether it's nil or not. Why would every single object have a "nil?" method?

You can make it work, but it's just not good style (and it doesn't serve the purpose of implementation efficiency or machine-sympathy, which I would give exception for).

(also, special characters in method names?! my complaints about ruby really don't end with these comments, these are just the most succinct ones)

Post reply on HN