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<10; i++)` because all things being equal, that's the real difference. You could argue against braces, but the I could also argue against the lack of braces. So the real difference is how you write the controlling section of the for loop.
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<10; i++)` is actually better for kids since it hides less and it is actually much more useful in the real world since that's how the most widely used languages do it. Or, are you one of those adults who thinks that hiding the real world from kids is a good idea?
I guess you could also say that there is a reason we make things slightly easier for beginners of any age. Like having training wheels. But that is so you don't get hurt and the computer is not going to hurt anyone if the program doesn't compile. I also honestly don't think age matters here after they've been through the second grade.
EDIT: Also, yes, you can leave the semi-colon off in a LinqPad expression. But I also don't see a problem with explaining what a semi-colon is to a second or third grader, in the context of programming. I could also say "good luck explaining those oddly placed periods to those same kids" and it would make as much sense.
> Learning `for(int i=0; i<10; i++)` is actually better for kids since it hides less and it is actually much more useful in the real world since that's how the most widely used languages do it.
C-style for loops are useful, though I think the historical window (that started with the dominance of C) where the most popular languages lack a direct and succinct way of expressing simple do-it-n-times iteration is closing.
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.
Ruby offers an abstraction that other languages don't. That doesn't mean that using the abstraction is a bad habit.
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.
What you're argument boils down to is that `10.times.do` is better than `for(int i=0; i<10; i++)` because all things being equal, that's the real difference. You could argue against braces, but the I could also argue against the lack of braces. So the real difference is how you write the controlling section of the for loop.
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<10; i++)` is actually better for kids since it hides less and it is actually much more useful in the real world since that's how the most widely used languages do it. Or, are you one of those adults who thinks that hiding the real world from kids is a good idea?
I guess you could also say that there is a reason we make things slightly easier for beginners of any age. Like having training wheels. But that is so you don't get hurt and the computer is not going to hurt anyone if the program doesn't compile. I also honestly don't think age matters here after they've been through the second grade.
EDIT: Also, yes, you can leave the semi-colon off in a LinqPad expression. But I also don't see a problem with explaining what a semi-colon is to a second or third grader, in the context of programming. I could also say "good luck explaining those oddly placed periods to those same kids" and it would make as much sense.