News for hackers. Stuff that matters.
Re:Async/Await will make code simpler by sim0n on Tuesday August 22, 2017 @12:22AM (#15069678)
I personally think that the syntax is great considering it's being added to an existing language. await/async allows you to opt-in to having your code behave in a synchronous-like manner, when you want it to.

One of the best things about JS/Node is that you can wait on I/O from different sources at the same time and since the async/await syntax is just sugar over Promises, you can do things like:

  const [user, notifications, messages] = await Promise.all([
    getUser(),
    getNotifications(),
    getMessages(),
  ]);
Instead of having to wait on I/O sequentially like:

  const user = getUser();
  const notifications = getNotifications();
  const messages = getMessages();
if awaiting were implicit.
Re:Async/Await will make code simpler by yarg on Tuesday August 22, 2017 @12:47AM (#15069788)
It's usable, it's powerful and it's not overly verbose - but I'd contend it's adequate rather than great.