ga-wdi-boston / js-function-context-this

Other
0 stars 126 forks source link

Change event handlers to use jQuery #37

Closed raq929 closed 7 years ago

jrhorn424 commented 7 years ago

Please abandon the DOM in this lesson.

The one, and IMO only point you have to remember about the DOM is that when you attach a handler, the DOM element becomes the calling context.

At one point, in some version of this lesson, it was literally a footnote. And that's all that was necessary.

Willing to change my mind on this!

Just want to emphasize that our learning objectives are not environment-specific. If we feel strongly enough about talking about the DOM here, we should add it explicitly as a learning objective.

raq929 commented 7 years ago

Actually, I thought then when we talked about it in the context of event handlers was when it clicked for people. The rest is pretty theoretical and they can't see how it would be useful.

On Tue, Dec 6, 2016, 4:18 PM Jeffrey Horn notifications@github.com wrote:

Please abandon the DOM in this lesson.

The one, and IMO only point you have to remember about the DOM is that when you attach a handler, the DOM element becomes the calling context.

At one point, in some version of this lesson, it was literally a footnote. And that's all that was necessary.

Willing to change my mind on this!

Just want to emphasize that our learning objectives are not environment-specific. If we feel strongly enough about talking about the DOM here, we should add it explicitly as a learning objective.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ga-wdi-boston/js-function-context-this/issues/37#issuecomment-265275220, or mute the thread https://github.com/notifications/unsubscribe-auth/ANRw2GYQJNC8GHnz0e1eT1XWalVLt6nmks5rFdERgaJpZM4LF3DH .

jrhorn424 commented 7 years ago

in the context of event handlers was when it clicked for people

That may be. If that's the case, we should use other events. Browsers aren't the only evented environment. Ever written an express app? You're writing custom event handlers for when certain routes are triggered.

I'm also still willing to change my mind about dropping the DOM from this lesson, but I want to encourage more discussion.

raq929 commented 7 years ago

I think people find this lesson pretty abstract and they don't understand how it relates to their projects. The click handler is a way to make it relatable. Talking about express apps at this point doesn't make sense as we haven't even taught node yet. I maintain that relating the material to something that they've already done is super-helpful. (As in, more than one person was like, "Oh, I get why we did this lesson now.") If there's other ways to relate it to things they've seen before this lesson, I think that could be a good replacement for the DOM in this lesson.