5 ms·
Wasn't that the original selling point of Node? That it used callbacks for async and that it was easier that way?
by hvs 13y ago
Wasn't that the original selling point of Node? That it used callbacks for async and that it was easier that way?
- wmf 13y agoNo, the original selling point was that Node forces all code to be async and Erlang is too weird.
- drderidder 13y agoNot the original point perhaps, but its come around to that. A couple years ago they settled on callbacks after a fairly active debate, as the least ambiguous option for continuation passing. As more people explore Node, callbacks are one level of abstraction too deep or just too tedious for some people. Fortunately there's a great selection of asynch modules to help them.
- AndyKelley 13y agoI really enjoy the callback paradigm. I love how powerful the abstraction of async code is. In procedural paradigm, there are some things that you want to accomplish that you simply cannot create an abstraction for, because the operation you want to do is time based. With the power of callbacks, you can abstract away complex things with a single function.
- jchrisa 13y agoI thought the original point was that it is JavaScript that can do stuff.
- _greim_ 13y agoAs AndyKelley mentions, the point was it being async and event-driven by default. JavaScript was chosen because it was the only language that was simultaneously popular and free of sync baggage.
- mahmud 13y agoThis became my all time favorite comment on HN. I have been laughing for a good 10 minutes.
- dragonwriter 13y agoThe main selling point of Node was that it was JavaScript, and since you are going to have to use that on the front-end anyway, you might was well use it on the backend. I've never seen anyone argue that callbacks are one of the easier ways of doing async.
- AndyKelley 13y agoNo, the main selling point is that it's an event-loop based paradigm where all the APIs are async by default. As opposed to python twisted or ruby eventmachine where you have to look for async versions of the libraries you want to use and people writing modules usually aren't even aware that you want to be event-based. So yes, grandparent is correct.
- marshray 13y agoSome people will buy into it for different reasons than others. This is a silly argument.
- arxpoetica 13y agoI've personally never had issues with the callback pattern. To the contrary, it forces me to have well-organized code, which is a ++.