11 ms·
As someone who is not very familiar with JavaScript: what makes it "pervasively asynchronous," relative to other languages?
by nlawalker 11y ago
As someone who is not very familiar with JavaScript: what makes it "pervasively asynchronous," relative to other languages?
- andrewstuart 11y agoPretty much all the code you write in JavaScript has to be non blocking otherwise the browser will lock up whilst it waits for synchronous code to finish running. Whereas programming Python or Ruby or whatever is mostly done in a linear manner with functions and return values, the approach to programming JavaScript it to use callbacks (or the more sophisticated ways of avoiding them, like promises), everywhere. Really everywhere apart from some straightforward data processing type functions which can be synchronous. So when you use the various libraries you will find that everything is built to be driven in a callback oriented manner. Callbacks are pervasive.
- nibnib 11y agoNone of this seems specific to JavaScript though.