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

You are correct in every statement, including the suspicion that you probably don't understand it fully yet.

The even more awful part is that you will do many more swearing once you understand it fully.

One of my favorites is: when you read "await", you think "wait here", but the execution does the complete opposite and immediately, at this point in your code, returns from the function.

In particular, the rest of the function code is wrapped up in a Promise and this is returned.