News for hackers. Stuff that matters.
Re:Kidsruby - Learn Ruby for kids by nyellin on Monday December 26, 2011 @02:29PM (#3393692)
Is Ruby really better than Python for kids? I find Python to be more consistent and less surprising than Ruby, although that sometimes comes at the expense of expressiveness.

For that matter, has anyone researched the (dis)advantages of teaching statically typed languages?

Re:Kidsruby - Learn Ruby for kids by jurre on Monday December 26, 2011 @02:39PM (#3393726)
I'm going to go out on a limb here and say that it really doesn't matter which language you chose, and that the fact that you find python less surprising is most likely because that's the language you know best out of the two?
Re:Kidsruby - Learn Ruby for kids by mhartl on Monday December 26, 2011 @08:32PM (#3394474)
it really doesn't matter which language you chose

KidsHaskell FTW!

Re:Kidsruby - Learn Ruby for kids by gerggerg on Tuesday December 27, 2011 @12:52AM (#3394953)
As an absolute first programming language it probably wouldn't be that bad with good instruction.

Trying to teach them KidsHaskell after they've become comfortable with KidsRuby on the other hand would probably be a bit more difficult.

Re:Kidsruby - Learn Ruby for kids by marquis on Monday December 26, 2011 @02:49PM (#3393758)
Well, my first language was LOGO. I don't think that disadvantaged me when I started C. I think it's all about the approach (add in the fact that in school our teachers gave out chocolate for whoever got their program finished first).
Re:Kidsruby - Learn Ruby for kids by ddagradi on Monday December 26, 2011 @02:57PM (#3393775)
I also think Python is a great teaching language, but I think it brings some confusing concepts to the table. Whitespace nesting is one of my favorite things in the world, but is a bit of a demanding idea to add for someone with no experience in code.

It remains unimportant, however, as the goal is to teach children foundational skills, not specific languages.

Re:Kidsruby - Learn Ruby for kids by jnbiche on Monday December 26, 2011 @04:41PM (#3394005)
I would argue that whitespace provides a visual cue to code organization that could prove critical to children learning to program. To provide an (adult) example of what a little whitespace and DRY can bring about, I'll describe my struggles to learn to program fluently. From 1998 until 2010, I did web design on and off, even working as a professional web designer for a few years. Although I was good at HTML, CSS, and design, I came from a non-CS background and struggled to learn Javascript beyond simple cutting and pasting of scripts and a little jquery. I eventually learned enough PHP to begin considering myself a programmer (yes, cue the laughter), but it wasn't until I started to learn Python a few years ago that I experienced a breakthrough.

Now I'm fluent in Python. After I was comfortable with Python, I went back to Javascript, via Coffeescript initially, and with the background Python provided, was able to grasp the fundamentals of Javascript to the point where I can now actually create full programs in JS. Since then, I've been able to pick up some C and am making excellent progress with Haskell. I attribute this programming epiphany to Python, and particularly to the visual cues that whitespace provides (along with "explicit is better than implicit"). Whitespace not only provides key visual cues to code structure, it also forces you to organize your code coherently before you can run it.

I've not learned Ruby, but I like what I've seen of it a lot. I'd love to have the opportunity to use it one day. However, I firmly believe that for some people at least -- including children learning to program -- semantic whitespace provides critical visual and organizational pedagogical support. For that reason, I think that Python, or even Coffeescript, would be a better first language for child (and adult) learners.

Re:Kidsruby - Learn Ruby for kids by ddagradi on Monday December 26, 2011 @04:56PM (#3394040)
I've definitely gone back and forth with that, and felt the exact same way when I learned Python. And I agree - semantic whitespace is a really great feature that makes Python simpler in a lot of ways.

Where I start to like it less is when I think about how much structure it imposes on the code before you can even write a line - it has the potential to remove some degree of experimentation. And how easy, for a new user, it could be to get it just wrong enough to be problematic.

Don't count me as a hater though. I would love to write Ruby with semantic whitespace - HAML already gets me halfway there!

Re:Kidsruby - Learn Ruby for kids by nyellin on Monday December 26, 2011 @03:09PM (#3393799)
The language makes a difference. I've seen many try to pick up programming and stop because they deem their first language too hard.

I agree, however, that foundational skills matter a lot. That's why statically typed languages might be better for learning to program, because they lay a foundation for understanding types.

Re:Kidsruby - Learn Ruby for kids by roestava on Monday December 26, 2011 @04:42PM (#3394010)
I recall Pascal and C when I was starting out and how tough it was to grasp them. But I also had trouble with Perl when I first encountered it. I got quite a bit done with some languages based on basic and with Delphi, when I could finally understand some of the errors I used to get with Pascal.

Based on my experience, I'd say that errors you get help you with learning about languages that make those errors evident. I learned about recursion before I learned about getting the compilers happy, for instance.

It's funny though that I can count Python as one of the languages that I've barely used and learned simply because I was never too fond of it.

Anyways. I think Ruby is a fine language as it resembles basic and doesn't demand ";" and parentheses, and it also has great OO support which helps with the documentation and even IDE support. With name completion, for example. Methods in Ruby are very straightforward and control-flow structures are plenty capable in Ruby. Not having to declare variables can also help, and Ruby does report some errors quite handily.

Cheers.

Re:Kidsruby - Learn Ruby for kids by jablan on Monday December 26, 2011 @03:11PM (#3393809)
Not trying to argue, just curious: what about Ruby you find surprising?
Re:Kidsruby - Learn Ruby for kids by nyellin on Monday December 26, 2011 @03:30PM (#3393862)
Off the top of my head (there is more):

* Floats are printed without rounding

* You can write x = foo unless foo but not x = foo if ! foo

Re:Kidsruby - Learn Ruby for kids by ddagradi on Monday December 26, 2011 @03:59PM (#3393922)
Floats are printed without rounding

Isn't that a good thing? I like knowing the real value I'm passing around. It does round...eventually (at 14 decimal places or so).

You can write x = foo unless foo but not x = foo if ! foo

This is incorrect.

Re:Kidsruby - Learn Ruby for kids by nyellin on Monday December 26, 2011 @05:38PM (#3394118)
I could have sworn I tried that a week ago and it didn't work. Thanks for the correction.
Re:Kidsruby - Learn Ruby for kids by getsat on Monday December 26, 2011 @04:54PM (#3394037)

  bash-3.2$ python
  Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
  >>> 1.2 - 1.1
  0.09999999999999987
Re:Kidsruby - Learn Ruby for kids by _genova on Tuesday December 27, 2011 @05:31AM (#3395377)

    >>> print(1.2 - 1.1)
    0.1