3 ms·
Although async and await do look great, I am not very keen on using try/catch for everything. Is this not going to end up with more verbose code? I appreciate i
by beck5 10y ago
Although async and await do look great, I am not very keen on using try/catch for everything. Is this not going to end up with more verbose code? I appreciate it will be impossible to ignore errors though.
- inglor 10y agoThere's https://github.com/zenparsing/es-typed-catch https://github.com/zenparsing/es-typed-catch to solve the problem I raised here 3 years ago: https://esdiscuss.org/topic/try-catch-conditional-exceptions-in-light-of-generators https://esdiscuss.org/topic/try-catch-conditional-exceptions... and there's a good writeup on problems with async/await by fellow bluebird contributor Gorgi Kosev (spion) here: https://spion.github.io/posts/es7-async-await-step-in-the-wrong-direction.html https://spion.github.io/posts/es7-async-await-step-in-the-wr... (Although I don't really agree with it)
- billmalarky 10y agoIn my experience async/await style code is much less verbose than callback style code. Like 50% less. Async/await style is also much easier to follow, especially for non-node developers, since it makes asynchronous code appear as if it is synchronous. That said I like to use the caolan/async library when dealing with async callbacks and that adds a ton of verbiage overhead in exchange for a more understandable flow of the data (in my opinion).
- Bahamut 10y agoThe async.js library has awful semantics - promises are an improvement in every way compared to it, whether it is reasons of flow, readability, and even perf (bluebird is quite faster). The catchall try-catch is my major dislike for async-await though. The only way to exit the async-await loop being to throw is overkill, and makes it more complicated to localize different desired flow branching.