6 ms·
Strong agree. I've seen devs with 20 years of experience on me write silly inefficient code because they're lulled into a false sense of security by the marketi
by only_as_i_fall 5y ago
Strong agree. I've seen devs with 20 years of experience on me write silly inefficient code because they're lulled into a false sense of security by the marketing of async/await.
Multithreading is one of the hardest problems in software, and Microsoft decided that the best way to solve it is to get smart and experienced people to stop forget everything they know and instead learn a bunch of opaque apis that interact with an incredibly complex internal state machine.
It hardly seems worthwhile to me.
- nobodyandproud 5y agoasync/await has its place, but your application needs to be designed for it. The most illuminating moment for me was when I realized that there is no multi-threading involved with pure async/await.
- bobcostas55 5y agoasync/await is not about multithreading at all though...
- only_as_i_fall 5y agoIn a vacuous sense, but in practice you almost always use asynchronous code to achieve concurrency. The canonical Microsoft tutorial on async spends about half its time talking about hiw to make your code concurrent to take advantage of async. https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/ https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...
- nightski 5y agoConcurrency does not require multi-threading. Maybe you mean parallelism? Concurrency can still be really valuable in the context of a single threaded application.
- joconde 5y agoIf a program wants to perform a task in an async way without delegating it to an external program (like a database server or the OS' I/O system), it has to use threads, right? I think the point is that concurrency, for some tasks, basically requires multithreading. Not for the parallelism benefits, but just to be able to make concurrency possible for a task that requires blocking a thread.
- nightski 5y agoConcurrency is more about having order independent units of computation. You can concurrently run operations on a single thread, although there is less benefit if no IO is involved. It's not something you'd likely do in practice unless there was IO.
- only_as_i_fall 5y agoI did mean parallelism, but I think the point stands. There's very little practical use of async await outside of multithreading.
- CuriousSkeptic 5y agoSyntax sugar aside. Wasn’t the simple scalability of single threaded async nodejs main selling point?