Wow so it turns out I was right, Javascript is a gross language that is impossible to read for anybody who isn't already familiar with its syntax.

I come from C/C++ and Python land when it comes to network request stuff, and I'm accustomed to code just executing one line after another. I can get used to the async stuff, but it's pretty damn frustrating that VS Code doesn't even have any indications to tell you when a function is going to be async or not.

There's also seemingly no immediately clean way to just say "don't continue, everything after this is going to rely on the result of this function".

Maybe I'm just bitching because I don't understand how await and Promises work.

#webdev #JS #html #async #raceCondition #programming

@riverpunk Promises are kind of the older way of doing things (mostly because they lead to a thousand nested lambdas) which are *supposed* to be replaced by await syntax, but not every library or function supports the new syntax...

Here's the short of what you need to know: Promises take a set of callbacks to invoke in case of success or failure. As an alternative, await says "instead of calling another function, just continue here" and throws an exception instead of calling a function on failure.

It's definitely awkward to get used to, but once you're used to it you kind of wish it was available in other languages like C++.