4 ms·
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 e
by nyellin 15y ago
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?
- jurre 15y agoI'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?
- mhartl 15y agoit really doesn't matter which language you chose KidsHaskell FTW!
- gerggerg 15y agoAs 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.
- marquis 15y agoWell, 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).
- ddagradi 15y agoI 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.
- nyellin 15y agoThe 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.
- roestava 15y agoI 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.
- jnbiche 15y agoI 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.
- jablan 15y agoNot trying to argue, just curious: what about Ruby you find surprising?
- nyellin 15y agoOff 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
- ddagradi 15y agoFloats 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.
- nyellin 15y agoI could have sworn I tried that a week ago and it didn't work. Thanks for the correction.
- getsat 15y agobash-3.2$ python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) >>> 1.2 - 1.1 0.09999999999999987
- _genova 15y ago>>> print(1.2 - 1.1) 0.1