3 ms·
async await was the biggest breakthrough for me. Made JavaScript code 3x more readable.
by macando 5y ago
async await was the biggest breakthrough for me. Made JavaScript code 3x more readable.
- contriban 5y agoConfirmed. Every time I convert an old Node project to promises I constantly find bugs and situation that were just lost in the hell. The result is also so much cleaner that sometimes you realize you were doing something wrong entirely and you scrap the whole thing. No other JavaScript improvement comes close. Everything else is nice but only saves a few chars at most.
- macando 5y agoAnd they announced promises like a big improvement over callbacks :D Now that was hell! Fortunately, when I started doing serious Node.js development, callbacks were already on the way out.
- BenoitEssiambre 5y agoI really wish when things moved to async/await, that they would have gotten rid of promises like I proposed here: https://es.discourse.group/t/callback-based-simplified-async-await/343 https://es.discourse.group/t/callback-based-simplified-async... As it stands it's layers of caching, state machines and complexity.
- Sephr 5y agoYour proposal seems very reminiscent of the generator-based JavaScript async library I created back in 2010: https://eligrey.com/blog/pausing-javascript-with-async-js/ https://eligrey.com/blog/pausing-javascript-with-async-js/
- Oddskar 5y agoIt's building on top of something that developers should be using anyway; or at least have familiarity with. I'm quite glad they ended up going this route for that reason.
- splendidHaiku 5y agoFor me too. Only thing I sometimes struggle with, is figuring out how to place error catches. Wrap each async functions body in a try catch? Or always attach a catch handler to the calling function? But what if I forget to do that? Should the caller or the callee handle the errors or can both?