News for hackers. Stuff that matters.
Re:“Node.js is one of the worst things to happen to the soft... by sanxiyn on Tuesday November 21, 2017 @02:46AM (#15746359)
The main argument is that "of all the ways of doing concurrency, callbacks are by far the worst". I tend to agree.

Now we have async/await, I think there is no problem.

Re:“Node.js is one of the worst things to happen to the soft... by konschubert on Tuesday November 21, 2017 @03:07AM (#15746462)
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.

Re:“Node.js is one of the worst things to happen to the soft... by emilsedgh on Tuesday November 21, 2017 @03:29AM (#15746567)
Nobody loved node because of callbacks. Node was the only ecosystem where everything was written with concurrency in mind.
Re:“Node.js is one of the worst things to happen to the soft... by dozzie on Tuesday November 21, 2017 @06:39AM (#15747209)
> 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.

Re:“Node.js is one of the worst things to happen to the soft... by zamber on Wednesday November 22, 2017 @07:44AM (#15756316)
JS 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?

Re:“Node.js is one of the worst things to happen to the soft... by abritinthebay on Tuesday November 21, 2017 @11:43AM (#15749167)
It 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

Re:“Node.js is one of the worst things to happen to the soft... by hungerstrike on Tuesday November 21, 2017 @11:31AM (#15749048)
> 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.