Reply to post: Wun thing to say.

The Wun Show: Douglas Crockford has been sniffing JavaScript's bad parts again


Wun thing to say.

I have to say, while I agree with his comments about callbacks and Promises (which look messy, and there's just no replacing callbacks with promises in existing code without tearing your hair out), he's way out of line about async/await. It's a really useful technique and makes the code much cleaner, easier to read (and write), and less error prone.

The worst problem with async/await is all the books and stackoverflow posts that explain async/await code as though it was happening sequentially. Which it most definitely is not. The number of times people have suggested you can call an async function from the main thread and wait for it to finish is depressing (though the fact that you can't do that is also depressing)

Also, in passing, I hate that JSON cannot be commented. Because there's a lot of tools (eslint, I'm looking at you) that expect their configuration to be in strict json format, and I like to explain why I've taken a decision in my configuration details, thank you very much. So I use yaml, but every time I want to do something, I have to take the eslint example and stick it through a json->yaml converter....

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon


Biting the hand that feeds IT © 1998–2019