r/javascript • • Jul 10 '16

The JavaScript language reboot is done

https://medium.com/@velmu/the-javascript-language-reboot-is-done-7bcec4be2cb6#.dy2fyy9j1
41 Upvotes

98 comments sorted by

View all comments

Show parent comments

10

u/ihsw Jul 10 '16

I think it is.

Callback hell is over, promises and async/await have won.

I challenge you to find any new ES6/TypeScript projects that still use anonymous functions for asynchronous execution.

10

u/namesandfaces Jul 10 '16

I actually find callbacks very manageable with observable streams, just as easy as promises. Code ends up just as comprehensible.

0

u/TheIncredibleWalrus Jul 10 '16

Callbacks aren't bad because of "callback hell" and the "pyramid of hell", it's about inversion of control and the trust problem

0

u/cosinezero Jul 11 '16
Don’t call my callback too early
Don’t call my callback too late
Don’t call my callback too few times
Don’t call my callback too many times
Make sure to provide my callback with any necessary state/parameters
Make sure to notify me if my callback fails in some way

Oh my god, these apply to every function call in my application! Promises are the hammers to all the nails!