Should I teach students who doesn't know computer science C or JavaScript first?

https://programming.dev/post/47695080

JS for sure.

It has a reputation among programmers as being a bit of a mess, but I think the reasons behind that reputation are largely irrelevant to your use case.

Basically:

  • It has some bad decisions about basic stuff, like truthiness, equality, coercion. But those aren’t major stumbling blocks, really. When they run into those situations, they’ll probably already be aware that they’re trying something weird and won’t have the same already-developed intuition about “how it should work” that many of us are bringing to the table.
  • Production deployment can easily turn into a Rube Goldberg machine. I think this is mostly what the kneejerk “really? JS?” response is about. Different ES versions, module systems, WASM, dependency hell, transpilers on top of transpilers, and a billion different runtimes. And the fact that everyone and their grandma apparently wants to build a custom DSL on top of JS that requires additional transpiler plugins or codegen steps. But your students won’t have to worry about that shit. Just pick one environment and do that. Maybe warn them that stackoverflow might use different syntax (require vs import) or try to import stuff that doesn’t exist in their environment though.
  • If there’s a need to introduce students to virtual DOM, I’d choose a library that doesn’t require language extensions or editor plugins, but allows to easily code with just the syntax of JS itself: properties as Plain Old JavaScript Objects, map/reduce with arrow functions, ternary operator, variables as usual, components as functions. Adding Mithril to existing WordPress websites for making dynamic parts such as calculators or quizzes was quite straightforward. On the other hand, its API is somewhat less convenient than what React offers.