Slashdot Mirror


Zuckerberg Shows Kindergartners Ruby Instead of JavaScript

theodp writes "If one was introducing coding to 10 million K-12 kids over 5 days, one might settle on a programming language for examples more than a few weeks before D-Day. But the final tutorials for the Hour of Code aren't due now until the day they're to be taught, so Code.org was able to switch the example Facebook CEO Mark Zuckerberg uses to illustrate Repeat Loops from JavaScript to what looks like Ruby (earlier /. discussion of the JavaScript example), which will no doubt make things clearer for the kindergarten set working on the accompanying Angry Birds tutorial. Khan Academy, on the other hand, is sticking with JavaScript for its Hour of Code tutorial aimed at middle-schoolers, which culminates in a project showing the kids how they can draw a circular plate by invoking an ellipse function with equal major and minor axes. By the way, as Bret Victor might point out, the 2013 Khan Academy lesson looks a lot like circa-1973 PLATO!"

25 of 144 comments (clear)

  1. What? by Anonymous Coward · · Score: 5, Insightful

    If one was writing a summary, one might settle on a summary that explained the point it was trying to make rather than providing a set of disconnected statements...

  2. At Long Last... by Anonymous Coward · · Score: 5, Insightful

    Ruby finds it's niche. IIRC Twitter switched anything that mattered from ruby to scalar / JVM the very moment their platform became more than a toy.

    He'd probably be better off showing them javascript, no need to install 3rd party software. Kids already have access to all runtime libraries and development tools with a web browser and a text editor. Really makes no sense to show them ruby.

    1. Re:At Long Last... by cmdr_tofu · · Score: 2

      Ruby is a beautiful language, much easier to learn (syntactically) than javascript. I don't know that Ruby is a better choice than Javascript, Python, BASIC, LOGO, or (Something else), but it does have some advantages for a young mind.

      1. 1. it's pure OO
      2. 2. control structures are intuitive. I prefer "for (;;) {" style, but "1.upto 100 do |counter|" style is more intuitive.
      3. 3. Cartoon characters can teach you Ruby lessons in a collaborative environment. This is mostly due to the work of one WhyTheLuckyStiff, but the work is done. Why not use it? http://hackety.com/
      4. 4. there is a great ruby community

      I do think that children preference should be given for open source technologies rather than proprietary ones (or at least the option should be given). Children should be able to take what they learn in school and run it on their own equipment without spending a fortune on a particular company's product. All of that aside, teaching your kids Javascript would certainly be worthwhile too!

    2. Re:At Long Last... by AuMatar · · Score: 3, Interesting

      Number 1 is actually a negative. The right paradigm to use for kids is procedural. First off because it matches how they're likely to think- plenty of stuff is broken down into steps 1,2,3 etc just like procedural, but nothing is broken down by objects outside of programming. Secondly, they have to learn procedural and structured code anyway to write functions- why confuse them with extra stuff? Teach them without objects first, then teach them objects- as an added bonus they're more likely to understand *why* they're useful.

      Three is an app. It can be written for any language. Its not a good reason to pick one language over another.

      There's great communities for every language. There's also horrible ones for every language. You just need to know where to look, which a teacher should. Not an advantage.

      You have exactly 1 point that stands up.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    3. Re:At Long Last... by AuMatar · · Score: 2

      I'm sure both other users of Smalltalk will agree with you.

      --
      I still have more fans than freaks. WTF is wrong with you people?
  3. Sigh by ledow · · Score: 5, Insightful

    Is it just me that thinks that, when aiming at kids, BASIC still probably is the easiest language to understand (if not the most rigorous)?

    The first example is just HORRENDOUS anyway - boilerplater and ternary crap getting in the way. The second is simplified using specific language facilities and objects.

    So what would have been wrong with a BASIC-like:

    FOR EACH USER IN USERS
            SENDMESSAGE(USER, "Happy Birthday")
    NEXT USER

    As I get older, I believe more and more than the creators of BASIC knew what they were doing, and make something kids and beginners could understand quickly even if it wasn't perfect.

    1. Re:Sigh by BenfromMO · · Score: 3, Insightful

      As I get older, I believe more and more than the creators of BASIC knew what they were doing, and make something kids and beginners could understand quickly even if it wasn't perfect.

      Well said, and I agree. The hint for me is in the name of the language. For children, you want something that gives near instant gratification and which they can understand as they go. Even the horrendous goto statements allow children to see clearly where things go...and so with children its probably is the best bet. You are not trying to train good programming quite yet at this level, you just want to interest children, so why not go with something that is not the buzz of the week?

    2. Re:Sigh by Nerdfest · · Score: 2

      The problem is that people keep writing things in these languages and they end up being extremely difficult to maintain because of deficiencies in the language. Yes, you can write bad code in any language, but a few of them encourage it. I grew up on BASIC, and it's one of those languages. You can write some of the best spaghetti in BASIC. Visual Basic was another.

      JavaScript is better but has *way* too many inconsistencies and gotchas. I think Ruby is a good choice, although I think a strictly typed language would be a better first language.

    3. Re:Sigh by csumpi · · Score: 3, Informative

      Agreed completely.

      The traps in both javascript an ruby can make even a grown person's head explode, let alone a kindergartner.

      I'm also not convinced by "block programming". OK, it's easy to make a pig move 3 steps forward by sticking three "move forward" blocks together. But that' gets old in minutes, and you want variables and functions. At that point (about an hour in) block programming becomes more of a hassle than typing "A=11".

      As for programming languages, there's also Pascal. Just like BASIC, it was created to for teaching programming.

      And why does everything need to be Angry Birds? (Which reminds me, nice slasvertisement again, timothy.)

    4. Re:Sigh by Anonymous Coward · · Score: 2, Interesting

      No, BASIC is also a pile shit in pedagogical terms: complex, fiddly, inconsistent, crude. Edsger Dijkstra described potential programmers exposed to BASIC as "mentally mutilated beyond hope of regeneration", but I increasingly think this description could be generalized to cover all students raised in the Algol school of programming - and since Algol begat C and Pascal, which in turn begat C++, Java, ObjC, Python, Ruby, PHP, and JavaScript, I think it sums up nearly all mainstream programmers today.

      Seymour Papert once had the right idea: you don't teach "programming", you teach structured thinking and analytical problem solving. That students learn how to program along the way is just a nice side-effect of the platform used, which in Papert's case was LOGO. Algolites frequently perceive LOGO as a toy language for little kids because it looks ludicrously simple compared to Algol-family languages, those vast baroque monuments to their own extreme cleverness. But any idiot can do complicated: it's doing it simple that's hard. Syntactically and semantically, LOGO only has two primitive structures - words and lists - yet it can express everything that a "proper" language like Pascal can. Heck, you can even learn Computer Science Logo Style, which makes me think that CS departments should actually be teaching LOGO as their first language.

      As Guy Steele once put it (back before he went to the Dark Side): "The most important concept in all of computer science is abstraction." And LOGO - bless its crystal clear sense of priorities - gets right to the heart of this, introducing itself like so:

      1. This is a word.
      2. This is how you run a word.
      3. This is how you add your own words.

      Simple, beautiful, and incredibly powerful and empowering. No bullshit, no fuss. Just the total essence of computer programming, expressed in terms that even a child can understand and use.

      Basically, the Algol-family languages teach students to "bang the rocks together" - the procedural ones neatly wash the rocks first, while the object-oriented ones paint them all shiny silver to show what hot shit they are. The apex of achievement is measured by how hard and rhythmically they can bring the rocks together, and how many rocks they can get through before their arms fall off. Whereas the Lisp school, of which LOGO is part, could not be less impressed by all this sturm und drang clatter of rocks. Their only interest is in learning how to use those original stones to manufacture flint knives, which can be used to fabricate clothing and axes, which can be used to construct buildings and forges, which can be used to smelt iron... and so on. Honestly, if civilization had been built by C and JavaScript programmers, we'd all still be living in caves today.

      The genius to LOGO's pedagogical approach is that what it teaches is not merely tool use, but tool creation. Start with a primitive core vocabulary, then build it out and enrich it until it can effectively and efficiently express your own specific wants and needs. And the reason it can get on and teach this right away is because it doesn't spend 99% of its time drowning its students in vast swamps of micromanaging make-work nonsense. The myriad 'special forms' that all those macho Real Languages so proudly present as if they're the most important and special fundamental concepts in all of programming - statements and expressions and operators and conditionals and loops and types and values and variables and punctuation and so on - turns out to be entirely unimportant and not special at all; it's just garbage, with no real value beyond obfuscating and distracting and keeping honest onlookers from developing the sneaking suspicion that most of today's programmers don't really know what they're doing nearly as much as they pretend to.

      It's just a tragedy that Khan and Zuckerberg and others have now progressed to the stage where they're now enthusiastically evangelizing their own Algol-crippled mentalities upon millions more. I'm sure they mean well enough it, but the world could really do without such Dunning-Kruger idiocy going recursive.

    5. Re:Sigh by Chemisor · · Score: 2

      So what would have been wrong with a BASIC-like:
      FOR EACH USER IN USERS
                      SENDMESSAGE(USER, "Happy Birthday")
      NEXT USER

      The fact that learning this example will help these kids grow up into spammers.

    6. Re:Sigh by fisted · · Score: 2

      Users.each{|user|

      That made my eye twitch. Gross syntax.

  4. Lazy kids by nbritton · · Score: 4, Funny

    Kids today are lazy. Back in my day, knowing assembly language was a pre-kindergarten requirement.

    1. Re:Lazy kids by Guppy06 · · Score: 4, Funny

      I worked with machine language in elementary school!

      (We used discarded punchcards in arts and crafts.

    2. Re:Lazy kids by gallondr00nk · · Score: 2

      Cretins! I built a working Difference Engine before even leaving the womb!

  5. My 5 year old says "Pft. Lamers." by stonebit · · Score: 5, Funny

    He says it's all C or nothing. C++ if you're weak but want to look cool. I can't believe how hard core he is. I had no idea 5 year olds could form such hard ideals about programming. He says at school, all the kids who use Java are picked on. Some of the teachers tried to front Ruby, but they just got all up in her grill.

  6. language wars still hot for good reason by bzipitidoo · · Score: 2, Interesting

    I tried introducing my nieces to a bit of programming. The older was about 7 when I tried it, and she hated it. The younger took her sister's lead and wouldn't even try it. Settled on SVG with reservations, thinking that drawing pretty pictures that a browser can display might interest them. Hoped SVG might be a little like LOGO in a browser.

    A big part of the problem was unnecessary complexity. Doesn't seem like any language does well on that. C or Pascal? Can't just dive in to those. Have to have some boilerplate (the "int main() {... return 0; }" stuff), and a bit of command line training to run the compiler (make is right out) and the executable, or some training to use an integrated environment. A "scripting" language like Perl does better on the boilerplate, but still need to learn extra stuff to get going.

    One of the problems with SVG is the underlying XML syntax. XML is horrible. It's not just verbose, but verbose in a redundant, cluttered way. Maybe syntax highlighting for XML like languages should set the names of closing tags to white on white or black on black, anything to reduce eye clutter. SVG isn't a true programming language anyway, have to at the least drag in JavaScript for that. Then you're into the whole mode mess, very much the same sort of thing with C and makefiles, and the C preprocessing directives.

    Cleaner, simpler syntax might not have been enough to make the difference. The girls are, I think, a bit prejudiced against the nerdy. But it would have helped.

    --
    Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    1. Re:language wars still hot for good reason by binarylarry · · Score: 3, Insightful

      I hope to god this post is some kind of bizarre troll attempt.

      --
      Mod me down, my New Earth Global Warmingist friends!
    2. Re:language wars still hot for good reason by msclrhd · · Score: 2

      Python is a good language to build up from the ground up -- just type "python" and you start a Python interpreter. You can then start typing. For example:

              >>> 5
              5
              >>> 5*2
              10

      This allows you to only teach the absolute minimum of what is needed at the time. You can even tie it into things like mathematics.

    3. Re:language wars still hot for good reason by fermion · · Score: 2
      A big part of the problem is that young people still think very concretely and still do not always get cause and effect. A big problem is that people focus on the language rather than the basics of programming.

      I learned to code simple things in basic, use a compiler, and run a program around age 11. But I did not learn programming until two years later using FORTRAN. But we did not get to FORTRAN immediately. We talked about how to break down a problem, how to write steps in simple statements, how to translate those steps in code. One of the first things we actually wrote ourselves was the swap function. No one told us how. We just did it, and learned about variables through code that did not produce the desired results. At that point we got to abstract thinking.

      Here is the nice thing about the computer. It will do exactly what you tell it. This means that errors in one's thinking and logic are concretely reproduced in errors in output. If one focuses on that then when a child becomes a teen, any language can be introduced, be it C, Forth, Python, FORTRAN, Ruby, Basic, Shakespeare and all will be well.

      This is why robotics is so nice for K-8 programming. First, the child has to create a procedure and code the procedure into the robot. If the procedure is not correct, the robot will not do what it is supposed to do. Immediate concrete feedback for a concrete problem. As the child gets older, more number sense can be added, and ultimately variables in terms of sensors, and logic based on those sensors. All concrete. The problem with robotics after grade 6 or so it becomes overwhelmed with the physics and engineering. It no longer is primarily a tool for teaching kids how to program.

      By time a child is 10-12, some can handle more abstract problems in the same way that some kids can deal with algebra prior to high school. This isn't necessarily something one can tell with test scores or based on how hard the student is willing to work. It is simply mental maturity. At this point formal languages can and should be introduced. The problems should become more abstract. I recall one of the things I things I did on an Apple II back in high school was use shape tables to display a 3D looking cosine function.

      In terms of what language to use, I have become fond of Python because it is powerful but does not have all the complexities of other languages. I have used it with high school kids to work up an online game. But initially the programming language should not the primary issue. A person who is a software developer, who can think abstractly, should be able to handle any language. Mandating a language is like mandating an Office application. You are limiting the flexibility of students to learn.

      --
      "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
  7. 10 years from now by Anonymous Coward · · Score: 3, Insightful

    Kids will be choosing to work at a McD's or writing JavaScript code. This is all tech industry's goal of making programming and development a skilled trade - much lower paying trade.

  8. hmmm by buddyglass · · Score: 3, Funny

    So this is kind of like letting them play with elemental mercury instead of chewing on chips of lead paint.

  9. Inconsequential by WPIDalamar · · Score: 2

    Did anyone watch the video? The code was completely inconsequential to what was talked about and only shown for a brief few seconds as a "ooooh look at code". It wasn't really meant to be read or understood.

  10. Re: I mean, they are kindergarten kids. by ShanghaiBill · · Score: 2

    Hey, I've worked with quite a few developers that couldn't write coherent sentences or spell. Not all of them were bad at coding, however.

    I bet they knew the alphabet, and could at least read the keywords. I volunteer for an after school program that teaches Scratch to 3rd and 4th graders. At that age (8 and 9) they are ready to understand programming. In kindergarten they are not. You can't keep the kids interested unless their programs involve graphics and animation. To do that, they need to understand distance, angles, and rotations.

  11. Wat? by Greyfox · · Score: 3, Interesting
    Wat?

    Ok, so technically learning to program doesn't have the same set of requirements as production programming. Back in the day you were likely to get BASIC and then moved on to Pascal, C, Fortran or (god help you) COBOL. Once you realize that all languages have essentially the same structures, you start to say things like "languages are just syntax. Learn to program in one language and you can pick up any other language very easily." This is not actually completely true, but I'll get to that in a moment. They also didn't tell you much about the environment beyond giving you the "vi cheat sheet" and instructions on how to invoke the compiler. Near as I can tell they don't do a much better job of it today.

    Rolling objects into the mix really doesn't change that much. You still need to know structural programming because you're going to need to write your methods and you don't want to write them as spaghetti. You have a whole other set of concepts to master for OOP. You can show people objects, but until they're ready for them, they're not going to understand them. I don't know how many people remember learning to program, but when you're looking at it for the first time, even basic language structure like function parameters (and functions) and variable initialization are confusing.

    So yeah, Ruby and Javascript might make OK learning languages, inconsistencies and all. Of all the ones I looked at when I was a wee programmer (And I looked at them ALL,) Logo and Pascal seemed like the most sensible. We did Pascal in my high school (in the '80's) in a programming environment on Apple II machines. They environment was mildly quirky, but didn't take long to pick up. That let us concentrate on the language. Logo offered the most immediate feedback about how your changes affected the behavior of the program. At least for me, immediate feedback was very helpful to the learning process. You can definitely get that with the interpreted languages. The same things that make them reasonable languages to learn programming also make them not-so-great for production projects, at least not without a lot of unit testing that no one ever bothers to write.

    Of course, the more you work with different computer languages, the more you start to realize that the statement that "all languages are the same" is not really true. You discover things like the ones mentioned in the presentation I linked to at the beginning of this post, and find yourself having to work around deficiencies in the language. At a basic level all languages are the same and once you learn the control structures you can write simple code in any language very quickly. To actually learn the quirks of a specific language and truly master it, that could take years. I'd go so far as to say that most programmers will go their entire career never having truly mastered a single language. What they give you in school are the tools to achieve that mastery, and I don't feel that anyone even does a good job of doing that.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?