Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
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:
  • by Anonymous Coward on Thursday March 01, 2012 @12:40PM (#39210099)

    No additional tools needed. Everyone watching a Khan video already has a JS environment.

  • 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?
    • Scratch is a nice intro to variables, events, loops, branches. But sadly, there are no methods/functions in Scratch. You cannot structure code, you cannot reuse code, any attempt to increase the scale of your Scratch project will result in frustration and very bad habits. It's alright to play with Scratch for a week or so. After that either give up on programming or move to the real deal.
  • Logo! (Score:3, Insightful)

    by Anonymous Coward on Thursday March 01, 2012 @12:43PM (#39210155)

    Silly mongols, you should use logo. You can even get physical, pen-wielding turtle periferals to show how what you code can make something real move.

    Ok, it really isn't good for much of anything beyond geometric drawings with nested for loops, but it has immediate, visible results using a subset of normal coding logic.

    • Re:Logo! (Score:4, Informative)

      by MindStalker ( 22827 ) <mindstalker@@@gmail...com> on Thursday March 01, 2012 @01:12PM (#39210617) Journal

      Try scratch. Its basically logo with drag and drop commands and better graphics. I recently retried logo and found the modern version of it highly confusing with its attempt to be heavily threaded.

  • Javascript (Score:5, Funny)

    by Thanshin ( 1188877 ) on Thursday March 01, 2012 @12:44PM (#39210167)

    alert("Khaaaaaaaaaaaaan!");

  • Sane choice (Score:2, Insightful)

    by acak ( 2362174 )
    This move should be vindicated in the near future. But I do have some qualms:

    - 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.

    ... (insert other features
    • Re:Sane choice (Score:5, Insightful)

      by tedgyz ( 515156 ) * on Thursday March 01, 2012 @12:52PM (#39210287) Homepage

      Since when do you teach complex casts and threading in an intro course? For crying out loud, I know engineers with 5+ years experience that still don't fully grok multi-threaded issues.

      • 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.

      • I grok the hell out of those multi-threaded issues... we're talking about /.'s layout yeah?
      • Most programmers don't fully grok multi-threading issues. Ask your typical programmer what a lock convoy (https://en.wikipedia.org/wiki/Lock_convoy) is and you'll get a blank stare.
        • Re:Multi threading (Score:5, Insightful)

          by gewalker ( 57809 ) <Gary.Walker@Astr a D i g i tal.com> on Thursday March 01, 2012 @02:45PM (#39212115)

          Not happening to know the term "lock convoy" does not imply that said programmer is unfamiliar with the issues. If you learned multi-threading long ago (like I did), no-one had invented the cute description, but you certainly knew how what the condition was and possible methods of mitigation. Sounds like a stupid "tech interview" type of question.

          I have programmed using threads in a number of different environments (phtreads, dce threads, and windows threads) in a number of different languages, and have taught threaded programming -- I have also threaded needles, reattached buttons, sewed, embroidered and read most of the Dragon Riders of Pern [wikipedia.org] series. I am a skilled and experienced threader. I had never heard of a lock convoy until now, but have certainly dealt with this precise issue before..

          I suspect you would not have just asked this question and "stopped the interview" because I did not know this term, but I get tired of hearing statements similar to yours, and worse, I've caught myself saying similar things.

    • by Bonker ( 243350 )

      - 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

      This is a fairly serious issue, but one that can be brought up after the basics of computer programming have been instilled. Most languages are either loosely typed, duck-typed, or have robust conversion features these days. Kids who learn to mangle a string in Javascript will pick up quickly on 'You have to use a 'to_str' method in some other

      • by tlhIngan ( 30335 )

        This is a fairly serious issue, but one that can be brought up after the basics of computer programming have been instilled. Most languages are either loosely typed, duck-typed, or have robust conversion features these days. Kids who learn to mangle a string in Javascript will pick up quickly on 'You have to use a 'to_str' method in some other languages'.

        If only that were the case - you start seeing a lot of reimplements of functions like "to_str()" and the inverse (strtoi/strtoul/etc) because what was tran

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

        by DarkOx ( 621550 ) on Thursday March 01, 2012 @02:14PM (#39211643) Journal

        Pointers in anything other than the very lowest-level-touching-the-metal code are an abomination. They cause far more confusion and grief than they ever help. Yes, there are situations in which the best way to address a problem is to pass a pointer around. However, in this day and age of multi-gigabyte ram sticks, I'd rather bloat up a program's ram usage with maybe unnecessary copies of large objects than dick around with pointers.

        I am going to disagree. There is basically no difference between C pointers and the byRef concept in all the higher level languages. It requires the same understanding, its just slightly different vocabulary and syntax.

        C method is superior because it makes it CLEAR when things are being passed by value and when they are not.

        C method is superior because it makes programmers consciously decide every time, if a reference or value should be passed. Not doing this results in code that passes massive objects by value and causes performance/resource issues, or often hard to solve bugs where values change in unexpected ways because multiple references exist and its not clear they are only references not clones.

        Not having pointer syntax is a mistake most modern languages are making IMHO.

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

      by dougmc ( 70836 ) <dougmc+slashdot@frenzied.us> 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.

    • Are they going skip the concept of Pointers ?

      Pointers are easy. The difficult thing is getting people to understand the concept of indirection. A language like JavaScript contains references, which teach you 90% of what you need to know about pointers. The rest - pointers to pointers and pointer arithmetic - is pretty trivial once you understand the difference between copying and aliasing.

  • Funny, a search for JavaScript on Khan Academy has no results!

    http://www.khanacademy.org/search?page_search_query=JavaScript [khanacademy.org]

  • Come from the fact that its syntax and features are set in stone, and every change either takes the w3c 10 years to establish a standard that's actually obeyed, or a massive browser feature war that leaves us with unimplemented blink tags. If the language itself could have evolved even as fast as slothful Java, it wouldn't seem so unintuitive as a first language.

  • Old News (Score:5, Informative)

    by DudemanX ( 44606 ) <dudemanx@@@gmail...com> on Thursday March 01, 2012 @12:54PM (#39210339) Homepage

    The video the article uses as its source is from October.

    The article also incorrectly states that this is Khan Academy's first programing language. There are a few intro to Python videos on the site already.

  • 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 program

    • Learning the unmitigated mess known as the document object model is. And then you have you worry about CSS if you want to do anything fancy. So in effect you have to learn 3 languages (2 above + HTML) , including how they interact and obtuse DOM system before you can do anything useful. And then we have HTML5 and the god awful canvas object interface. I feel sorry for the kids, BASIC would be a better choice.

    • by grumbel ( 592662 )

      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.

      Not really. The default "development tools" of your browser are complete shit, half the time you won't even get an error message when something went wrong and printf-style debugging isn't all that easy either and of course you need to have a HTML to even start doing Javascript, which adds a another layer of complexity. So as a beginner you are confronted with a lot of "stuff doesn't work" without even a hint on what went wrong. Of course you can fix that by using browser add-ons, predefined HTML pages and a

      • by mwvdlee ( 775178 ) on Thursday March 01, 2012 @02:21PM (#39211805) Homepage

        half the time you won't even get an error message when something went wrong

        FireFox, MSIE, Safari and Chrome all have a javascript console which prints plenty of error messages. F12 is your friend.

        printf-style debugging isn't all that easy either

        You can log text and data to the javascript console using console.log(); or any of the other debugging features like line-debugging.

        and of course you need to have a HTML to even start doing Javascript, which adds a another layer of complexity.

        ...and teaches you to create documents to relatively loose syntactic rules before switching to the more strict rules of JS.

        I agree that javascript isn't the nicest language out there, but it's probably the best compromise.

  • Autoit [autoitscript.com] is a good scripting language. Not too hard yet not to easy since you gotta know, like every other language, what you do. I know almost nothing in programming and I found AutoIT very fun and very good scripting language. Well very good is a wierd term for me since I didn't use other scripting language. From what I read on their forums [autoitscript.com] and their pdf tutorials [autoitscript.com] (available on their forums) is it helps you learn good basic programming behavior from the start.
  • by a2wflc ( 705508 ) on Thursday March 01, 2012 @01:02PM (#39210459)

    Since then he's gotten pretty good with Java, C#, C, and python and played with F#.

    The key part of the title is "intro language". Seems like some comments are expecting kids to come out of this and write the next Office suit, or Google competitor, or missile guidance system. I think javascript is a great way to see if a kid wants to do more.

  • 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.
    • Paradoxically, I think Javascript closure is something that should appear more natural, to the beginner.
    • Amen to this. Perl's like that, too, to some extent: write code, save file, run script, see immediate output. Lather, rinse, repeat.

      Unlike the inexcusably broken Xcode 4.3, which won't even run - not even doing anything, just sitting there! - longer than five minutes on my machine.

  • 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.

  • I guess it's a practical choice then. JavaScript is widely used and they can move their skills to the AJAX and Metro world.

    For the more nerdy types, the "if you want to be a sushi cook you will have to start as a kitchen cleaner" route could be offered as an interesting alternative route. There you would begin with C and assembly...to learn a bit how processors work (machine language, registers, stack) and how to write lean code. Raspberry Pi would be the hardware and, you would have a dedicated mentor to g

  • Bad idea... (Score:4, Insightful)

    by xyourfacekillerx ( 939258 ) on Thursday March 01, 2012 @01:22PM (#39210757)

    Teaching programming to children isn't even about teaching PC's or teaching a particular language, it's about imparting the ideas behind turning "what we want the computer to do" in our imagination (the kids will later call this algorithms) into instructions for the computer. BASIC and others are languages were designed as introductory because they can be used without much regard for external environment, allowing a natural focus on the fundamentals of all programming in general.

    The child then develops an intuitive understanding of what s/he will later describe as algorithms, data structures, and programming languages, or platforms, in general; they develop the theoretical foundations subconsciously via exercise, habit and practice, (and for the gifted, introspection and critical thinking), so they can be taught these concepts formally with ease later on. At that time, the choice of programming language isn't much of an issue.

    But this? JavaScript requires the teaching of an environment and pre-existing objects like DOM that have nothing to do with the above goals and will certainly diminish the natural intuitive development of the appropriate concepts involved with programming. They are not learning how to translate their imagination into instructions as a general practice; they are learning how to manipulate specific pre-determined objects outside the scope of theoretical concerns. This is bad for them. This will limit them.

    As an aside, let's face it, this is motivated by business. 1) JavaScript will be a heavily used language in the immediate future, 2) Khan prepares students to use JavaScript, 3) Khan's students are equipped with business-world skills and succeed, 4) Khan claims statistics reflect it competes well in the education market place, 5) Khan gets money.

    Meanwhile Khan's students have to learn the basics of programming the hard way. Like a GED student picking up calculus at age 35 struggles with it, so will those students.

  • Anyone who is anyone knows that real programmers use Speedware.

    ugh... I shudder just typing that- even though it was in jest...

  • If the goal is to groom students to be web app developers and nothing else, then Javascript with HTML/CSS are perfect choices for a first language. For a more general curriculum, I'd suggest a more general purpose language like python or Java.
  • The QML language is amazingly simple to learn and contains javascript snippets to drive the complex stuff. It has much better concepts of variable bindings than HTML/Javascript alone and is significantly faster (and runs on pretty much everything).

    I recently taught a child QML and had her create a Mahjong game for her mother in a couple of weeks. I did some of the harder javascript logic, but she did most of the entire game from scratch. Oh, and she learned git in the process and the concept of simultani

  • I don't get why Python isn't the choice here. Javascript, I find, is a horribly ugly language, harder to understand and code in than most, and with more quirks, special cases, and generally horrible-to-work in language design choices than pretty much any other language in common use today.

    Python does it right for learning. It teaches good practices (indentation, code readability), it aims to not surprise the user, it's a well designed language which is very good at being consistant, and in general is nice to learn in. Not only that, but it avoids the low-level stuff (which isn't that relevant when you are first learning to code) and instead teaches you the higher-level concepts which are more important. It's also got a large, well documented standard library, and is interpreted, so you can use it as a prompt, and don't have to worry about compiling. It's also cross platform, free and open.

    I'm not going to lie, I don't like JavaScript, and I've never got why people like it. I can understand using it - it's the only real choice for scripting on the web - but to use it out of choice, or teach in? I don't get it. Fun and graphical? Not really - then it requires an understanding of HTML and CSS too, which is either going to be done wrong or be too much.

    My main problem is the line

    Resig admits JavaScript, as a language, has its warts and issues, but so do all languages.

    - This is true, but some languages try really hard to avoid them, and some fix them. Python is an example of both - Python 3 fixes a number of issues with the language, and in general, with the process of PEPs and not being afraid of pushing the language forward, Python has turned into an extremely polished language with very few issues. JavaScript on the other hand, is full of them - and there is no real effort to fix them, as far as I know of, at the moment.

  • Javascript is easy, has a similar syntax to other C-like languages, no compiler/environment needed as a browser is enough, enables embedded scripting thus giving instant feedback. A good language for beginners.

  • That's like saying a web developer knows how to program software. Developing scripts for the web, and writing software are two different things. They should be teaching JAVA, not Java Script!
  • by mckinnsb ( 984522 ) on Thursday March 01, 2012 @02:15PM (#39211667)

    It's a great way to introduce kids to the basics of programming languages without miring them in the ( necessary as they grow more proficient ) details of memory management and computer science fundamentals such as data design and system architecture. It also falls into a very interesting class of languages - a class by its own really - which exposes kids to some of the concepts of procedural languages and some of the concepts of imperative languages.

    But more importantly, Javascript - whether or not more traditional computer scientists like I would like to accept it - is likely a gigantic component of the computing future. Its the language that runs on the most platforms, and is used for nearly everything. Right now, many of us are familiar with how Javascript handles interactivity on webpages, but did you know that Javascript is actually used to route the majority of phone calls placed through cell networks? Did you know that most SmartTV manufacturers ( GoogleTV, Samsung )are producing SDK's and API's to produce "Apps" on their televisions written 100% in javascript (instead of the "window" host object you have "volume"...etc)? Did you know that it's being used in factories ( along with python ) to control the movements of industrial robots? With the advent of server-side event-based asynchronous web programming in javascript like Node.js as well, and the beastly v8 engine being BSD licensed, its importance will only increase over time as people find more ways to embed it as the primary interface scripting layer.

    It's good thing to expose people to, for sure.

    • Here's a better way. http://www.toontalk.com/ [toontalk.com] I bought this for my daughter when she was 4, the software was awesome with it's lego like look, she had the hang of looping for if whiles in a few days.
    • by T.E.D. ( 34228 )

      but did you know that Javascript is actually used to route the majority of phone calls placed through cell networks?

      No, but that explains a lot...

  • The kids coding in Javascript at Khan Academy have produced better code than 90% of the web's developers.
  • 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 [appspot.com] a little while ago, give them a try and let me know what you think.

On the eighth day, God created FORTRAN.

Working...