3 ms·
JavaScript runs everywhere, and every web browser these days has really good JavaScript dev tools built into it (nothing to install). Python might be a bit eas
by mikece 4y ago
JavaScript runs everywhere, and every web browser these days has really good JavaScript dev tools built into it (nothing to install). Python might be a bit easier in terms of syntax but if the kid has an interest in tinkering then learning how to search/parse the text of a website using the browser's Console, that can be the gateway into NodeJS programming.
- Koshkin 4y agoIndeed, the plain HTML plus JavaScript have been the best option for a kid to get a taste of programming ever since they became available. I find Python to be more useful in general (should be taught in high school to everyone, in my opinion), but it is just less fun for a kid.
- 8bitsrule 4y agoStart with a simple HTML template called with 'theirname.html'. Add a JS loader: <script src="theirname.js"></script>. Load that page in browser; bookmark it. (Easy access!) Now whatever they edit into theirname.js will 'run' when they reload the page. e.g. alert('Hello World!') When they're ready to add an image, time to learn a little HTML ;-O
- Koshkin 4y agoA little interactivity helps to keep the kid engaged. It is amazing to see how much fun emulating a simple desk calculator in HTML can be.
- jfengel 4y agoI concur, which I think is ironic since I think Javascript is a terrible language. And I don't say that lightly, because I view most programming languages as being pretty much on par. They're all fine; the differences are more about framework and support than the language in itself. Javascript is one of the few languages so poorly thought out and so badly evolved that I actually say it's a bad language. And yet it's ubiquitous, easy to learn, and (after decades) has reached a point where you can mostly step around the worst of the landmines. I'd even say that Typescript is pretty good, though it's probably best for a first-timer to be able to skip that.
- trinovantes 4y agoJS is probably one of the worst languages for a beginner Its execution model (single threaded, libuv callback scheduling) will be extremely difficult to understand without some OS background knowledge. It's also different than almost every other mainstream language so it's not even transferable Its tooling beyond the browser console is still awful. Good luck explaining ESM/CJS and transpliers to a beginner It has a non-existent stdlib compared to other libraries so you have to explain how to use npm/yarn/pnpm, how to pick the right package, how to resolve paths to them, and eventually bundle them with webpack/vite/snowpack/etc...
- ravi-delia 4y agoI feel like all of that is secondary compared to the fact that JavaScript lets a kid immediately create something they can see. Sure, if you want to teach CS it's not my first choice, and if you want to interact with things you'll need a library, but once you add in that kind of stuff you're stepping up a complexity level anyway. Anything you need to build something simple is in the language, and along with HTML you can build things cool enough that there's time to learn before you outgrow it. Once you get around to making a real application those issues all apply, but I mean my first brush with programming was Minecraft mods and they're a million times more finicky. I stuck with it even though I was writing in notepad++ and taking 5 minutes to test each change because the end result was something a 12 year old wanted! Obviously there are better purely pedagogical languages (I'm partial to Racket myself), but those are suited more for the classroom. In terms of getting a kid hooked, in this day and age the best option is JavaScript. Back in the day it was Basic, even though Basic sucks and sucked for anything complicated. For me it was a janky Java setup I downloaded off of a shady forum. The execution model or transpilers have nothing to do with it.
- trinovantes 4y agoI agree that video game modding (Java for Minecraft or Lua for Roblox) is also a great introduction/motivator for learning programming. The key thing is even though these languages may also be as complex as JS, using them for modding usually have a "happy path" to getting started with many complexities abstracted away or completely disabled for obvious security reasons. Alternatively if they do not play those games, then maybe a visual programming language like Scratch would be suitable.