Hacker News new | past | comments | ask | show | jobs | submit login

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.



There's 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... 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-wr... (Although I don't really agree with it)


In 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).


The 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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: