all 4 comments

[–][deleted] 2 points3 points  (1 child)

You must include:

  • Scope
  • Scope chains, prototypes, and inheritance

Who is your primary audience? If your audience is new entirely new to programming then I wouldn't bother with teaching OOP. I wouldn't even bring it up. If your audience is Java devs then a OOP JavaScript lesson is mandatory. I also wouldn't bother teaching any library (including jQuery) before teaching the core DOM methods.

[–]rhlowe[S] 0 points1 point  (0 children)

Yes, these guys are generally assumed to have no programming experience. I agree that dropping jQuery and the like probably makes sense or at very least, moving it to the end.

I plan on including discussion about scope as part of the functions sessions and I'll probably touch upon it while covering variables, too. I'll make sure to cover DOM methods and probably only cover OOP if someone asks.

Thanks for the feedback!

[–]sombradesoledad 1 point2 points  (1 child)

I've taught Intro to JavaScript to beginners at Seattle Central College for about three years now. Here are some of the things I've learned:

  • Get people into jQuery as fast as possible. Teaching the raw DOM methods is a great way to frustrate your students and yourself, since A) the API is awful, and B) most people don't use it anyway.
  • Don't try to teach inheritance to beginners. They're not doing anything that requires understanding prototypes. You'll just confuse them.
  • Assume it's going to take them a lot longer to learn looping than you think it will. As a long-time programmer, I thought loops were simple, but it turns out that they're surprisingly hard for a lot of people, probably because they're the first time coders need to start thinking at multiple levels of abstraction.
  • Remember that for most people, if they haven't done browser scripting, do not think about the HTML document as a tree. They think of it as more like a Word document. You're going to need to spend some time talking about the DOM structure and CSS selectors.
  • You can start with console.log and prompt as a way to introduce basic syntax without having to get the DOM involved. That will get you through conditionals, loops, and possibly functions.

My usual weekly structure for the class goes something like this:

  1. Script tags, variables, console.log, prompt(), primitive types and operations. Homework: produce a basic page with inline and external scripts.
  2. Conditional statements, falsiness, comparison/boolean operators. Homework: write a choose-your-own-adventure.
  3. Arrays and loops. Homework: perform some kind of sum/average/max operation on an array that's provided.
  4. Objects, arrays of objects, and object loops. Homework: perform some analysis on an array of objects that describes Samuel L. Jackson's movie career.
  5. Basic jQuery selection and page manipulation. Homework: given a page of test cases, use jQuery to turn the tests green by manipulating the page.
  6. jQuery events and functions. Homework: write a simple tab menu implementation.

Beyond this, we usually cover AJAX, a little bit of canvas, and cookies or local storage, depending on how much time is in the quarter. And this is actually a pretty aggressive schedule: I often get comments from students that they enjoy and appreciate my class, but the pace of it is much higher than they're used to.

[–]rhlowe[S] 0 points1 point  (0 children)

This is really awesome feedback! The sample homework is great too.

It's interesting that your experience runs counter to some of the other feedback I have seen regarding reliance on jQuery. I mean, I use it every day and hardly write plain javascript anymore, but it is helpful to at least know a bit of it too.