News for hackers. Stuff that matters.
Re:.NET 5.0 by dragonwriter on Tuesday November 10, 2020 @05:23PM (#25052884)
> If you're writing modern nodeJS you're probably not using callbacks or promises (directly) anymore

I get that some people prefer async/await (I actually find explicit Promises clear enough that I don't have any strong preference, myself), but why wouldn't you be using explicit callbacks, which in my JS experience (mostly frontend, but also fairly modern) are super common outside of promises, which is the only place where I see modern JS replacing exlicit callbacks with a different structure.

Re:.NET 5.0 by vosper on Tuesday November 10, 2020 @09:04PM (#25054779)
Yeah, callbacks are fine until you get a big stack of them (so-called “callback hell”). Promises were the touted solution to callback hell, async/await the touted solution to endless promises chaining. While async/await is (tasty) syntactic sugar for promises, I think it’s a real improvement over callbacks - it’s one less argument to every function (because of promises) and I think it’s easier to read: there tends to be less nesting.
Re:.NET 5.0 by dragonwriter on Wednesday November 11, 2020 @03:44AM (#25056645)
The weird thing about async/await is that it gets you out of deeply nested callbacks into, pretty much by definition, exactly equally deeply nested async function calls. The only thing that seems different is that it seems to be more common (but not any more or less supported, since you can obviously have named non-async functions and you can also have anonymous async functions) to call named functions in async/await and anonymous functions defined inline as callbacks with promises.