Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Education Programming

Khan Academy Chooses JavaScript As Intro Language 355

jfruh writes "Slashdotters (many of whom cut their teeth on much-maligned BASIC) have long debated what language kids should learn programming in. Khan Academy, the wildly popular producer of educational videos, has come up with an unorthodox choice: JavaScript, not least because of its ability to keep kids' attention with something fun and graphical."
This discussion has been archived. No new comments can be posted.

Khan Academy Chooses JavaScript As Intro Language

Comments Filter:
  • Scratch (Score:4, Interesting)

    by gmuslera ( 3436 ) * on Thursday March 01, 2012 @12:41PM (#39210111) Homepage Journal
    Well, Javascript is not basic, and they can test their programs in any browser, but... why not scratch?
  • by KrackerJax ( 83403 ) on Thursday March 01, 2012 @01:00PM (#39210425)

    I got modded down as Flamebait, so I feel a bit vindicated now :)

    Post from Saturday July 25 2009:
    "One not-so-obvious candidate: JavaScript and HTML.

    Pretty much every browser in existence supports JavaScript, so with nothing more than a simple text editor and your browser of choice you can be off and running. As far as beginning programming is concerned, JavaScript easily encompasses any programmatic constructs you'd need.

    The best part is that the students can easily display the results of their test programs in HTML, either dynamically generated or just by manipulating some divs, textboxes, tables etc that they've written on their page. Additionally, an instructor could write a 'playground' bit of HTML and JavaScript, so all output variables are bound up and easy to access. At that point the student is free to focus on what really matters, his/her first logic routines. When the student has created his first masterpiece, sharing the accomplishment with parents/peers is as simple as sharing a link to their HTML file.

    I think this has the potential to engage students much faster than observing console output or fighting with a front end like windows forms in VB or Swing in Java."

  • Re:Sane choice (Score:4, Interesting)

    by capnchicken ( 664317 ) on Thursday March 01, 2012 @01:08PM (#39210549)

    Well this is going to fuck up a previously up modded comment here, but I had threading and sockets in my Intro to Java course freshman year of college and am very glad I did. Not sure what is so complex about type casting in a statically typed language, its fairly necessary. You don't fully understand them there either, but that only comes with experience anyway.

    On the other hand it was an advanced intro course, and I already spent a lot of time screwing around in Q-Basic in high school, in which had done none of those things. But the non-advanced intro class still had threading and sockets and what not, they just waited until the second semester to introduce them.

  • The right choice (Score:5, Interesting)

    by XxtraLarGe ( 551297 ) on Thursday March 01, 2012 @01:09PM (#39210571) Journal
    I think that's the right choice. All you need is a web browser & text editor. It's easy to get immediate results. It has a C-style syntax, so it will help them with other similar style languages like C++, Java and PHP. Can you really imagine starting kids off with C++ or Java? You could argue for Python (it's what Udacity is using), but I think it's dissimilar enough from other languages that it could cause confusion.
  • Re:Sane choice (Score:5, Interesting)

    by dougmc ( 70836 ) <> on Thursday March 01, 2012 @01:16PM (#39210661) Homepage

    - Appreciating data-types, their limitations and the perils of using casting them incorrectly helped me a lot in understanding about things I need to be careful about
    - Are they going skip the concept of Pointers ? It's not wise to use them unless necessary but to be aware of the concept was very rewarding for me
    - How will they teach multi-threaded programming? We're not quite there yet in JS.

    Your first language doesn't have to support every programming feature. BASIC certainly didn't support any of these (except data-types to a very, very minor degree) and many of us did fine with it. While data types are important at the beginning to do anything in many languages, we don't really teach pointers or threads (if a language even supports them) until later, so I don't see this as a big problem here.

    I'd say for the purposes of Khan Academy, they need something easy that will keep people's attention (as it's mostly aimed at youth who have no real obligation to keep on paying attention unless it's interesting) ... and so, given it's graphical nature, this sounds like a good choice. Their second language can be more fully featured.

  • by Entropius ( 188861 ) on Thursday March 01, 2012 @01:19PM (#39210713)

    I was given the assignment of teaching an intro computational physics class at a university two years ago using C. The students came in knowing no programming (or Linux), and I was supposed to get them comfortable writing C codes to simulate things in two hours a week.

    The trouble with C is that graphical output requires a bunch of advanced concepts; I wanted to give them a way to animate their simulations just using the things they already knew (which, at that point, were basically math, for, if, and printf/scanf)

    One of the first things they learned was shell I/O redirection (the | operators), so I wrote a command-line filter that read text in from stdin and translated it into animations, with support for various graphics primitives in 2D and 3D along with some interactivity (rescaling/translating on the fly by keystroke input into the animation window). So they could code up a simulation of some thing (a double pendulum, say), and watch it go in front of them. To my surprise it was a lot faster, even over remote X, than I thought it'd be. The huge advantage is that it let them get pretty graphics using nothing other than printf on their end.

    Some of the stuff they made by the end was pretty impressive: vibrating 3D meshes showing the oscillations of a stretched membrane, the resonance between Jupiter and the asteroid belt developing, and the like.

  • by Kagetsuki ( 1620613 ) on Thursday March 01, 2012 @01:19PM (#39210731)

    That an JavaScript is an extremely "loose" langauge with a lot of quirks. Context of "this" changing randomly? Check. Accidentally redefining functions? Check. Variable raises (AKA variables not defined yet somehow exist before their defintion)? Check. The vaguest duck typing system of any language ever? Check. Awful, awful class definition syntax? Check. Total lack of a reasonable debugging environment? Check. Almost complete lack of ability to deal with binary (or even non-text) information? Check. I mean the list goes on and on. As for a "programming" languages go it's just a horrible mess. Even with node.js it's difficult to consider it a general purpose langauge. Tell me JS is a good language for learning compiting and programming paradigims and I'll spit on you.

    As far as practicality goes? It's pretty practical. If you know JavaScript enough to use jQuery and AJAX you can do something to make money.

  • Re:Scripting (Score:4, Interesting)

    by HornWumpus ( 783565 ) on Thursday March 01, 2012 @01:54PM (#39211295)

    Ask 100 programmers what 'best practice' is and you will get 100 answers.

    Want to start a flamewar? State that _any_ OO language isn't a 'real' OO language like other OO language.

    Personally I don't think it matters what a persons first programming language is, as long as their second programming language is some sort of Assembler. OK I will allow Assembler 3rd, C second.

  • by YoJ ( 20860 ) on Thursday March 01, 2012 @03:17PM (#39212665) Journal
    I'm a fan of learning JavaScript as a first language, it can be presented in a nice way. One of the best parts of js is closures, it really gets them right. I put together some interactive js lessons to teach closures [] a little while ago, give them a try and let me know what you think.

Variables don't; constants aren't.