I don't believe the book is ready to ship yet, but I'm looking forward to when it is! I had the pleasure of working with Linda (author of this book) a few years back and she is really a wonderful person and I'm very happy for the initial success of Hello Ruby.
Hello Ruby – Almost there
101–110 of 128 posts
Re: Hello Ruby – Almost there
#102The 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.
I also backed the book with the understanding that it would essentially use pseudo-code. For as long as I've followed it this has never been advertised as a book about learning a language, it's always been presented as a book about learning basic concepts.
Re: Hello Ruby – Almost there
#103Earlier quoted context omitted.
If I'm on a Mac there is no setup; Ruby is pre-installed. Also, if they are just starting out and they don't want to keep things around there is tryruby.org. For kids using Windows I usually have them sign up for a free account on Cloud 9; again virtually no setup required. Also, now you are trying to compare LINQPad, a tool, to just using a language? In your example you used `Console.WriteLine("Hello World")`, excus…
The kids could also not have Macs and there are similar services for running C# online, so those reasons don't hold any water with me. What you're argument boils down to is that `10.times.do` is better than `for(int i=0; i Now on that point alone, I'd say that `10.times.do` is certainly easier to parse, but easier is not better. Why teach them a bad habit? Learning `for(int i=0; i I guess you could also say that ther…
I agree that C-style for-loops can be handy, but the prevalence of this shorthand doesn't make it good pedagogy to skip right to it. Not everybody is ever gonna enter the real world of programming, and not all of those people are going to use languages with C-style for-loops, and, even then, for-loops aren't fundamental; they're just a shorthand.
Re: Hello Ruby – Almost there
#104Earlier 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...
How is it strange? Feels rather intuitive to me: "Do this 100 times".
> 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...
Again: how so? `nil` is just another object, so why shouldn't it have a method telling us if it's nil?
Of course, if you don't like it, you could check to see if it equals `nil`, or you can check if its class is equal to or is a subclass of `NilClass`. Like Perl, There's More Than One Way To Do It (TM).
Re: Hello Ruby – Almost there
#105I'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…
Ruby also has lambdas, which if not first-level functions, are pretty darn close.
> It doesn't have namespaced imports, instead its imports effectively behave like includes (i.e. the "dump truck" approach to imports).
I can't tell if you're talking about `require` or `include`.
`require` is strictly meant for loading source files. If you want things to be restricted to a particular namespace, you should use `include` to pull in a particular module (once the module's code has been `require`d or otherwise `eval`d or defined).
> Ruby isn't widely used in practice
What? Ruby on Rails is ridiculously popular as a web framework.
> Installing it requires some amount of care and technical knowledge
On Macs and many GNU/Linux distros, Ruby is already preinstalled.
> don't even bother installing it with a Linux package manager -- you're almost guaranteed to end up with the "wrong version" of ruby and rubygems
Um, what? The only thing I can think of is a really old packaged Ruby. Otherwise, it's actually pretty hard to go wrong, in my experience having installed Ruby on pretty much every GNU/Linux distro known to man.
> but it would be nice if there were well-written books aimed at a more general audience.
O'Reilly and Pragmatic Programmers both publish a wide variety of excellent Ruby programming books that are very much "aimed at a more general audience".
> I'm not sure what the "best" first programming language is. JS has its merits
Oh good god no.
> and all you need to try it out is a modern web browser.
If that's what matters to you, then you can do the same with Ruby. Take a look at tryruby.org, for example.
Re: Hello Ruby – Almost there
#106I'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…
I'm sure I can agree that Java, C#, Python, or Javascript are any better than Ruby in terms of difficulty of installing and maintaining the "right" version on your system, or in terms of quirks that are not present in other languages. Python's block definition syntax can be extremely confusing to beginners. Idiomatic Javascript is very difficult to explain to a newbie. And Java and C# are overloaded with so much boil…
Having said that, Ruby is the superior language to Python once you get going, in my opinion, because of what it steals from Smalltalk.
Re: Hello Ruby – Almost there
#107I'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…
I don't think it's just that Ruby isn't a good intro to programming. I don't think Object Oriented languages are a good intro to programming. OOP is just way too abstract. In the teaching I've done (some adults and kids) they tend to get the basics of FP where everything is just a list much better than the weirdness of objects.
What confuses newcomers is the computer science vocabulary that everyone insists on using when teaching objects. I am a big fan of object oriented programming, but the vocabulary and terrible metaphors of introductory books reads like punishment.
The only language that has done a worse job explaining a simple concept is Lisp with macros. My God! It's like they're trying to keep Macro's a secret.
Re: Hello Ruby – Almost there
#108Earlier quoted context omitted.
If I'm on a Mac there is no setup; Ruby is pre-installed. Also, if they are just starting out and they don't want to keep things around there is tryruby.org. For kids using Windows I usually have them sign up for a free account on Cloud 9; again virtually no setup required. Also, now you are trying to compare LINQPad, a tool, to just using a language? In your example you used `Console.WriteLine("Hello World")`, excus…
The kids could also not have Macs and there are similar services for running C# online, so those reasons don't hold any water with me. What you're argument boils down to is that `10.times.do` is better than `for(int i=0; i Now on that point alone, I'd say that `10.times.do` is certainly easier to parse, but easier is not better. Why teach them a bad habit? Learning `for(int i=0; i I guess you could also say that ther…
Ruby's particular form may be different than others, but lots of current languages have succinct, direct methods for expressing the same thing. By the time a young child learning to code today is a professional programmer, having nothing better than C-style general for loops to express that common idiom will probably be unusual in non-legacy languages.
Re: Hello Ruby – Almost there
#109Earlier quoted context omitted.
I don't think it's just that Ruby isn't a good intro to programming. I don't think Object Oriented languages are a good intro to programming. OOP is just way too abstract. In the teaching I've done (some adults and kids) they tend to get the basics of FP where everything is just a list much better than the weirdness of objects.
I think objects are intuitive. After all, we live in a world made of objects. What confuses newcomers is the computer science vocabulary that everyone insists on using when teaching objects. I am a big fan of object oriented programming, but the vocabulary and terrible metaphors of introductory books reads like punishment. The only language that has done a worse job explaining a simple concept is Lisp with macros. My…
We do not live in a world made of object in the OOP sense. (On a more fundamental level, we don't live in a world made of objects at all so much as a world we are prone to arbitrarily -- and not always consistently -- break up into objects for the convenience of thinking about it, but those objects still aren't OOP-style objects.)
Re: Hello Ruby – Almost there
#110Earlier quoted context omitted.
I write Ruby for my day job (about a year and a half now) and C# for my own stuff (about ten years) and I'd go with Ruby as a pedagogical language ten times out of ten. C# is a good (not great, but good) language for building stuff you want to put in a production environment, but there's so much drag in the language that I would seriously worry about discouraging novices long before they get to the point where Ruby w…
I think you have to understand Types when working with Ruby. Otherwise it's just syntax voodoo. That's a big part of what helps a language like c# continuously reinforce a mental model that leads to better/easier understanding. IMO. You can call `open` and pass it a URL in Ruby. But what does that return? What's the Type? Where do I look up documentation for it? What's available to me _right at this point in my code_…
I'm curious, though. When you say "Ruby", how much of that was outside of Rails? I don't intend that as an ad-hominem, but rather in the exploration of a theory that I've had for a while. I am wondering if the approach one takes to learning the language and the ecosystem influences how much "magic" there is to Ruby. What you describe sounds familiar from friends and colleagues who learned Rails, and Ruby incidental to it. I only vaguely know Rails at all, I don't use Ruby for web applications beyond a Sinatra server as a dumb API.
(And, as I said, RubyMine has a stop-the-world, click-around debugger, much like Visual Studio. I've only used it once or twice, because the REPL is comfortable to me, but it does exist.)