Hacker News new | ask | show | jobs
by tranced 1887 days ago
Hey there, I've also taught lots of students online!

In my JS courses, I actually don't touch upon async things until I get to rather advanced/intermediate courses. Universally, I think the fundamentals of programming languages can be taught without too many drawbacks and agnostic of language choice unless the language is super verbose.

For example, all the things with closures, this, and asynchronous programming probably aren't relevant until a student runs into them/their gotchas while making web applications. By that point, I think framing it as event driven programming makes a lot of sense and gives context without being forced to deal with the details.

I think doing anything cool in other languages is also almost similar. A while loop/game loop in Python or other languages is pretty similar to the event loop which where the asynchronous nature of JS comes from. This becomes really apparent when working with games like Roblox/Lua and Minecraft/Minecraft plugins+mods.

1 comments

Yes, yes, it is similar, and I maybe didn't get that across as well as I could have. JS is the default (for good reasons!), but IME if we're talking about game engines aimed at beginners that are suitable for getting programming concepts across, I feel a [synchronous] game loop is often easier to get across conceptually, to build on. And then yes, definitely framing it in the same way works really well because when they get stuck, you can point them at that and say "well you've already done something really similar here, here's the comparison, {unpack how the async stuff is working by framing it in the same way}, you should be able to now link these concepts together"

(Apologies to other commenters as well! I got a little bit salty when people mentioned async in relation to beginner programmers because it's not a simple thing. It's abstract and doesn't really make a bunch of sense until the beginner has built a floor of very basic programming to stand on)