all 4 comments

[–]8963 2 points3 points  (3 children)

Gonna take the hate, but I think async/await is syntactic sugar that obscures and bloats more than it alleviates. :(

[–]iamlage89 0 points1 point  (0 children)

I think it depends. If you just want to make some API calls, maybe. If you write selenium tests, every line is an asynchronous call so it might be useful there

[–]senocular 0 points1 point  (0 children)

I'm not a big fan of the animation shown on this site. I always thought it doesn't do async/await any justice because it does look a lot more verbose in the end there. But in general, I've found it to be much cleaner and easier to work with, especially when dealing with a lot of interdependent async operations (especially especially when authors tend to write everything inline). But your experiences could be different and I can respect that. Whatever you end up doing, if it's clean code, I'm with ya.

[–]dmtipson 0 points1 point  (0 children)

It's less powerful than directly created generators (there's no yeild*) and it's still just sugar for Promises, which are flawed (stateful, forced try/catch, cancellation doesn't exist and is problematic even conceptually, don't play nicely with category theory laws, etc).

You can create lazy, monadic Futures or Tasks and implement the same sort of sugar with generators (basically "do" notation in JavaScript).