5 ms·
But it's funny, isn't it? Callbacks were advertised as the reason why one should use node. They're a foundation of JS. Then they got covered up by promises. A
by konschubert 9y ago
But it's funny, isn't it?
Callbacks were advertised as the reason why one should use node. They're a foundation of JS.
Then they got covered up by promises. And now, with async await, we're back full circle towards the style of a more linear programming language such as python.
- emilsedgh 9y agoNobody loved node because of callbacks. Node was the only ecosystem where everything was written with concurrency in mind.
- dozzie 9y ago> Node was the only ecosystem where everything was written with concurrency in mind. Yes, sure, if you ignore all the other programming languages, like Erlang, which is older even than first hacked versions of JavaScript.
- zamber 9y agoJS was drafted in a week. Node is a band aid on top of a tech stack that webdev is stuck with. Node was done with concurrency in mind, JS wasn't. Compare apples to apples: How does Erlang's ecosystem stack up when it comes to concurrency? How does it compare to Node? Do you even care given your prejudices regarding JS?
- hungerstrike 9y ago> Callbacks were advertised as the reason why one should use node. They're a foundation of JS. Where can I see that advertisement? I'm pretty sure that the main selling point of Node.js is and always has been that you can easily share code with the browser.
- deleted 9y ago[deleted]
- abritinthebay 9y agoIt wasn’t that callbacks we’re a selling point, it’s that asynchronous execution was. Callback were just the way of doing that in JS. Now we have Promises + Async/Await as sugar around what is basically the same pattern ie - cb(err, result) is not that different than .catch(err).then(result) but it’s much nicer to develop with. Of course now you can do the same in imperative try/catch for with await so yes, we’re back to similar syntax but a whole lot change under the hood and provided a much more performant concurrent model