News for hackers. Stuff that matters.
Re:JavaScript async/await implemented in V8 by AgentME on Monday May 16, 2016 @10:45PM (#11711085)
I hope the node APIs are changed/extended to return promises eventually so I don't have to keep on using promise wrappers for all of them.
Re:JavaScript async/await implemented in V8 by BinaryIdiot on Tuesday May 17, 2016 @12:39AM (#11711373)
Is there a reason you always wrap them? Even if it's awkward I tend to leave most platform APIs alone and treat them as special cases if I'm doing something, say, promises or messages.
Re:JavaScript async/await implemented in V8 by WorldMaker on Tuesday May 17, 2016 @12:32PM (#11714975)
Promises are much each to compose. Promise objects can be passed around and reused. (Multiple things can wait on the result of the same promise.) Code is much easier to read with flat .then() and .catch() chains, versus sometimes the "pyramid of doom" callbacks can create. Code is much, much easier to read with Promises when you can use async/await, and getting everything wrapped to promises now makes it that much sooner you can use async/await.
Re:JavaScript async/await implemented in V8 by BinaryIdiot on Thursday May 19, 2016 @02:07AM (#11728340)
I get the why people want to use Promises in general but when they're used to simply wrap a standard node / browser call feels dirty to me because it changes what you expect it to return (e.g. a promise instead of whatever it normal returns).

I dunno I just don't like to give the impression I'm changing anything about how I'm accessing / using the standard library but I guess this is a bit subjective.

> versus sometimes the "pyramid of doom" callbacks can create

If you structure the code well you never run into this (callback soup is very overblown; if you find yourself in that position then someone screwed something up). But I get promises and async / await are nice :)