Hacker News new | past | comments | ask | show | jobs | submit login

Yes, default environment is the browser, that's a given and that's fine: if you are a beginner, making stuff happen there is easy and rewarding. Everyone has easy access to it

[I apologise for being a little snippy here]. I don't have an issue here: I don't think you & sibling commenters are really getting that these are beginners I'm talking about. Yes, I am aware of async/await. With the browser being the default environment, a beginner has to understand callback-related programming with JS quickly: they need to be able to say "I want to do this then this". You have do this via callbacks. You can write JS synchronously, but IME this isn't practical.

Using async/await isn't some magic bullet here. You can write synchronous-looking asynchronous code, but the level I'm talking about is: what does asynchronous mean? What does synchronous mean? Once they've got that (which is not simple), what's a Promise? That one's fun because you need to explain the concept and how they work first, and generally that's gibberish. Async/await helps, so say I ignore Promises and go straight to that. At which point the learner starts getting errors to do with unresolved values. And back to Promises we go. And so on.

I would say that I don't think there's any magic language that makes things easy for learners, and JS has many advantages over any other one, mainly to do with its general accessibility. But it's a fairly weird language in how it works, it isn't the simplest.




I fully respect that these things are not easy for a complete beginner! I might not have expressed it very clearly but that’s what I tried to say; the browser environment requires you to deal with asynchronicity to do almost anything other than log to the console, so that makes it a tough place to start.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: