Last week I tried an experiment of teaching Javascript by diving straight into jQuery, animations, and API calls, without going over the fundamentals.

The big caveat here was that the students already had:

1) Two days of Python.  (In other words, programming wasn’t brand new.)

2) Two days of HTML/CSS.  (So writing for the web wasn’t brand new.)

Overall, I’m going to say that the lesson plan was a stunning success.  The kids picked it up remarkably quickly.  There was enough open-endedness in the activities that the faster kids had stuff they could work on, and most of them managed to get their very own image search engine working by the end of the day, which is awesome.

Some of the kids had questions that indicated that they wanted to better understand what was going on under the hood.  One example of this was I got two questions about how Javascript’s passing-a-function-as-an-argument worked, though nearly everyone else was happy to just accept it as “you put a name of a function as the third argument, and that’s what’ll get called later”.

There’s only three big things that I’m going to change when I run this next time in August:

1) I don’t think they reeeeally understood how APIs work; at least not deep in their bones.  What I mean by this is that they were able to rattle off the definition back to me, but further probing revealed that I don’t think they actually understood that when they called the flickr api, flickr was giving them information that they did not have hardcoded anywhere.  They were talking to a different computer.  They were one half of a two-computer conversation.  That said, they’ll be writing their own backend later this week, so by then I’m sure they’ll understand it better.

2) I relied pretty heavily on “this works just like foo in Python”.  While that’s fine for teaching these kids, it means that the curriculum isn’t reusable with a group that doesn’t have those two days of Python experience, so I want to re-think this a little.

3) A few kids were pretty confused at the end about best practices in terms of when to use HTML versus CSS versus JS.  This is a reasonable confusion since it is confusing. 🙂  But I want to give some thought to how to better break down some rules of thumb for them.

So there you go.  One student later blogged:

Today we worked on JavaScript, using the JQuery library. Though I do know some JavaScript through Codeacademy […], I never really formally learned it like Python or Java. It was nice to learn all the things that make like easier. Like how […] importing the library was inside the html. I really like JQuery.  We made some cute animations and then an image search engine for flickr. We also looked at lots of cat pictures. That made me happy. This class made me hate JavaScript a bit less now that I’m not frustrating about using a language before getting to learn it.

Hating Javascript a bit less?  That’s all any of us could ask for! 😉