3 ms·
Callbacks are still widely used in JavaScript. The "callback pyramid of doom" was horrible and we're all glad that it's sorted out through Promises and Async/Aw
by arcturus17 5y ago
Callbacks are still widely used in JavaScript. The "callback pyramid of doom" was horrible and we're all glad that it's sorted out through Promises and Async/Await, but functions as first-class language members remains one of the best features of JavaScript, and if a dev is not passing around functions somewhat frequently I would really question their credentials as a "modern" JS developer. Callbacks remain some of the best and most elegant solutions to a range of problems that are not at all uncommon.
- BeefWellington 5y agoIn practical terms Promises just moved callbacks into .then() instead of a function parameter and encouraged the use of pre-written functions instead of anonymous inline functions. It solves a lot of legibility problems. It was entirely possible to write nice-looking Javascript before Promises were a thing; people just didn't.