How Do People Deal Without Async/Await?

How do you guys even do asynchronous code in your programming language? It seems like everyone is copying C#'s method of doing it and even then it's not as good and easy as C#'s way. Why is everyone copying and still playing catch up?

Attached: AsyncAwait.png (1022x681, 86.92K)

>copying C#'s method of doing it
lol
lmao
rofl

Using async/await is the simplest thing of the world. Make you write your code as if it was synchronous. What is this retarded question?

Not every language has it, and those that do, aren't as simple and efficient as C#'s async await.

Callbacks existed for decades. But I agree, async/await (or similar concept) is way better than fucking callbacks. The error handling alone in nested callback is nightmare. By the way, can you switch threads with async/await in C#? Probably you can, but if for some reason you can't then it's pretty bad. In Kotlin (which I use) you can easily switch from one thread to another and then back to the caller thread in suspend functions (aka red/blue functions).

lame, come back when you have zero cost async/await like Rust.

Attached: Screenshot from 2022-06-13 22-13-37.png (963x824, 179.93K)

Async/await model is outdated and overrhyped. Look at Kotlin/Go coroutines

I never minded the concurrency system in Go, using C# most of the time currently and I don't think the async/await automatic state machine building is all that amazing. It's quite productive though.
I've looked at co_await / co_yield type stuff in C++ and it does not look enjoyable to use without the language support you get in c#.

Rust is truly the greatest programming language of our generation.

Attached: Screenshot from 2022-06-13 22-16-11.png (1686x797, 115.45K)

No nighly required. Rust stabilized zero cost async/await 2 years ago.

Microsoyboys on suicide watch right now.

Attached: Screenshot 2022-06-13 at 22-17-35 Compiler Explorer - Rust (rustc nightly).png (1613x578, 118.45K)

Good luck chaining multiple tasks and error handling them with that method.

C# did it in 2011. Rust is about 9 years late to the party and is still copying C#.

The `?` operator does that for you.
Rust is the most powerful programming language.

uh oh, C# still can't copy Rust's zero-cost async await.
Keep up, boomer

what's wrong with promises

Real languages have these things called "threads", you'll learn about it when you grow up

Does C# not have actual threads?
use std::thread;

let thread_join_handle = thread::spawn(move || {
// some work here
});
// some work here
let res = thread_join_handle.join();

Attached: file.png (287x397, 57.34K)

futures
stackfull coroutines
etc... none of this is really new.

>Does C# not have actual threads?
Don't be stupid, of course it does have it since 2003.

real languages implement their own threading abstractions though, boomer.

When did rust get so based, bros? I thought it was supposed to suck

Attached: 1654659268157.png (614x768, 453.44K)

it never did.

Real languages don't need a thousand retarded abstractions on top of basic features because they're used by real programmers.

>can you switch threads with async/await in C#?
kind of
awaiting an async method will switch from background thread to the caller thread, which can be optionally disabled
also all async methods run synchronously until they hit await, you can forcefully create another thread by using Task.Run()