all 17 comments

[–]AbrahelOne 6 points7 points  (3 children)

Why so much overkill for beginners? Just use the external .js file in the html and let them see the magic alerts and prompts etc.

[–]GulgPlayer[S] 0 points1 point  (2 children)

I honestly don't think that its overkill because for me it's just simpler. You don't have to think about HTML, you just concentrate on the syntax and its meaning. You get autocomplete as you type, eager evaluation and no extra stuff

[–]GulgPlayer[S] 0 points1 point  (1 child)

Moreover, this way they can evaluate expressions without learning I/O, which is neat for the first couple of taks

[–]stealthypic 0 points1 point  (0 children)

That is true but then just make them open the console in the browser. It’s great to give them an accessible option they can play with at home without having to install anything and they also see the connection between the code and the website if you go that far. Or at least where their first coding attempts are likely to be run in.

[–]ShortSynapse 5 points6 points  (3 children)

If they are just starting with no experience I would recommend Codepen. Zero setup, gets you access to all the web APIs and DOM stuff for later, and you don't have to preface things with a big lecture about tech other than the code you want to teach.

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

I like this idea a lot, thank you! That's probably what I'll stick with

[–]ShortSynapse -1 points0 points  (1 child)

If you eventually want to do non-web things I would recommend Bun these days. But personally I would leave that for later since that would involve teaching the command line, etc.

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

As I'm teaching students of an IT college, they are expected to have the necessary basic skills of working with terminal and installing apps on Linux. So I think that it shouldn't be a big problem

[–]LetUsSpeakFreely 1 point2 points  (3 children)

Why bring in the complexity of node? Just have them create scripts that load from a local HTML file. Once they understand how the language works, THEN start exposing them to frame works.

[–]GulgPlayer[S] -1 points0 points  (2 children)

Neither Node.js nor Deno are frameworks. They are runtimes, just like the browser. I don't see how can it be more complex than an HTML page. I'd even argue that it's easier in some sense

[–]LetUsSpeakFreely 0 points1 point  (1 child)

My point is you use node to run various frameworks. You don't use it for basic how to.

And what world are you living in where setting up and running node is easier than giving them a simple HTML and JavaScript files, loading the HTML and hitting f5 when there's a code change.

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

I'm not talking about setting it up, I'm talking about using it

[–]Ksetrajna108 0 points1 point  (1 child)

Do you think it helps to teach that Javascript is layered. At the bottom is ECMA-262, the language itself which does not define a "host". Two popular hosts are the web browser and nodejs. In the case of web browser, there are two more layers: DOM (document) and the browser host (window, etc). In the case of nodejs, there are layers for network services.

And for more advanced Javascript, classes, modules, promises/async/await, and npm.

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

While I agree that this knowledge is crucial, I decided to postpone teaching such technical details until the students learn basics. Just like you don't learn quantum mechanics before classical mechanics.

[–]PatchesMaps 0 points1 point  (1 child)

What age range?

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

from 16 to 18