The statement "Javascript is an asynchronous language" is simply not true#60
Conversation
…true. Javascript is blocking in nature; it's Node that supplies the asynchronicity.
|
Yeah, that sentence is wrong, we should fix it. It really should state that JavaScript is a synchronous language that executes in an event loop. The asynchronous part comes into play when you use a callback with some non-blocking input / output ( like node or a GUI ) |
This statement is also not accurate, but requires clarification. Javascript has many scenarios in which it can produce asynchronous behaviors. In Javascript, an asynchronous programming event occurs independently of the main program flow. Asynchronous style programming allows the main program flow to continue processing, usually passing the belated instructions as a value. see Continuation Passing Style. In javascript, async programming was first popularized by AJAX, but prior to that was common, for example in the timer model. Nodejs has two layers of async events, in Javascript and between Javascript and the C++ bindings. @Marak draws a very good analogy between the browser and Nodejs with event loops and I/O. I'd love to see an update which includes some variation of marak's remarks. |
|
Sorry, but did you read the requested change, or stop immediately when you disagreed with my comment on the commit? How about we discuss the edit, instead: "Node enforces an ansynchronous coding style [...]" Since we're not here to debate the relative merits of my commit message, but rather to correct something that is grossly inaccurate, I think its a bit extreme to close this issue as if its resolved. |
|
Technically, nodejs does not enforce an asynchronous coding style, the culture surrounding nodejs enforces an an asynchronous coding style. A better edit might be "Nodejs promotes an asynchronous coding style from the ground up". I think this pull request can be closed, but you're absolutely correct to take issue with the statement made here, it's confusing and inaccurate. Thank you for taking the time to raise this issue! |
|
Can we reopen this then and have a new pull request for it? Seems to make sense we should fix it in the context of this issue/conversation rather than open a new pull request, unless you have other plans. |
|
ya, can we re-open this? when an issue is closed there's no way to add more commits to help resolve the issue. Here's my updated edit: https://github.com/wookiehangover/docs/commit/5582d4c2d625b22907b58239da92ec9a2c5d8a01 |
… of "synchronous" languages in favor of a broader statement about "popular web frameworks."
The statement "Javascript is an asynchronous language" is simply not true
|
thanks for the merge! |
|
no thank you for paying attention to the details and speaking up when you saw something that needed correction! =) |
The statement "Javascript is an asynchronous language" is simply not true. Javascript is blocking in nature; it's Node that supplies the asynchronicity.