Aaronontheweb / EvilRoslynAnalyzers

Has your boss gone insane and banned LINQ at work? Why stop there - use this Roslyn Analyzer to ban extension methods altogether!
https://www.reddit.com/r/dotnet/comments/1c4hz1z/linq_forbidden/
Apache License 2.0
31 stars 2 forks source link

Feature idea: ban `async` / `await` #8

Open Aaronontheweb opened 4 months ago

Aaronontheweb commented 4 months ago

Why? It's too difficult to reason about what's going on with all of these crazy Task<T> everywhere. We should just use Task.Result as that's more management-friendly.

jmderuty commented 4 months ago

When using async await, the naughty compiler generates state machines, this cause several blocking issues:

Using Task.Result fixes all these issues.

Aaronontheweb commented 4 months ago

Unknown compiler bugs might generate incorrect state machines.

Should I flag this as a security issue then too? Seems scary to me

NimaAra commented 4 months ago

Tasks are evil in general, they result is threading issues and will need to be allocated to local and global queues which the threads in the ThreadPool need to steal from each other creating extra work for the Thread, the CLR and CPU. Synchronous code is always the better option, simpler to reason about, no allocation and lighter on the pool. Creating new Threads is the way to go.

Aaronontheweb commented 4 months ago

ThreadPool need to steal from each other creating extra work for the ThreadPool

Wow, so await is THEFT?!?!

jmderuty commented 4 months ago

ThreadPool need to steal from each other creating extra work for the ThreadPool

Wow, so await is THEFT?!?!

We would need to involve the legal dep to be sure, but for now legal, security, performance and geopolitical risks associated with the feature clearly warrant it to be banned.

NimaAra commented 4 months ago

One 100 percent. This is one of the best kept secrets within Microsoft, nobody can talk about it cause they are all under NDA. Now you know where the money to keep Azure running is coming from.

jmderuty commented 4 months ago

I'm ready to die on this heap.

NimaAra commented 4 months ago

Revolution

iSeiryu commented 4 months ago

@jmderuty Sure, some of us are ready to die on that heap, but are you ready to die on that stack?

jmderuty commented 4 months ago

@jmderuty Sure, some of us are ready to die on that heap, but are you ready to die on that stack?

Actually, async await destroys stacks. That's one of its crimes.

Aaronontheweb commented 4 months ago

image