4 ms·
That's a fair point, but I think the name itself ("await") tends to communicate the the operation might take a long time. Compare that to multithreaded language
by nolanl 11y ago
That's a fair point, but I think the name itself ("await") tends to communicate the the operation might take a long time. Compare that to multithreaded languages like Java, where it's not obvious that FileInputStream/HttpClient/etc. could take a long time!
Anyway, the big benefit of async/await, to me, is that you really DON'T have to understand promises. :) For instance, at some point we will probably add ES7 examples to the PouchDB API docs (e.g. here: http://pouchdb.com/api.html#create_document http://pouchdb.com/api.html#create_document), and you can imagine that, from the user's perspective, the word "await" will just be part of the API (e.g. `var doc = await db.get('id')`), and beyond that, they won't have to learn anything about promises or async or callbacks or any of that.
- inglor 11y agoWhat happens when they have to perform two things that are unrelated and suddenly their performance is down the drain because they `await`ed them all?