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

29

u/[deleted] Jul 10 '16

Callbacks obsolete? Seems premature to say so.

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/[deleted] Jul 10 '16

[deleted]

1

u/TheIncredibleWalrus Jul 10 '16

Amen, I can't believe the amount of replies it took for this reply to come up (out of a few agreeing upon the OP's misguided view on callbacks).

3

u/[deleted] Jul 10 '16

I agree. I've never found major issue with callbacks.

IMO, so many of the "problems" with JS are due to the vast majority of people who look at the community and apply fixes/patterns/designs without understand how it actually affects their code.

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!