3 ms·
Very well-written and easy to follow, wish I had read this a couple years ago :) I would love a follow-up that fills the gap about the relatio ship between gen
by moritzwarhier 2y ago
Very well-written and easy to follow, wish I had read this a couple years ago :)
I would love a follow-up that fills the gap about the relatio ship between generator functions and promises though.
This part seems very transparent in practise, but I think they're also the reason why the article gets slightly fuzzy at the end.
It claims that 99% of developers need not to care about promise "unwrapping".
But isn't that what powers every async function with more than one "await" in it?
Would also love to read a thorough breakdown of immediately resolved promises and their duality with setTimeout(resolve, 0).
- gabrielsroka 2y agoSee my comment above and also https://news.ycombinator.com/item?id=40825220 https://news.ycombinator.com/item?id=40825220 And https://news.ycombinator.com/item?id=40240905 https://news.ycombinator.com/item?id=40240905
- etse 2y agoAgreed. This is very well written. I discovered the joy of Go from dealing with JavaScript promises while writing an API service in Node. So many painful runtime errors uncaught or unlogged because promises don’t (or didn’t) require the catch callback. I think inverting the programming perspective to default to sync instead of async is more productive for web services development, than perhaps for UI.