3 ms·
If Rust async isn't colored, so C#'s.
by leosarev 6y ago
If Rust async isn't colored, so C#'s.
- bouke 6y agoIn C# one has to take the synchronization context into account. Calling an async method in a synchronous method while blocking, will lead to deadlocks sooner or later on various implementations. For example ASP.NET (non-Core) only allows 1 thread to enter the context. Now you could sprinkle some ConfigureAwait(false) over your code, but that means you can no longer access HttpContext inside your code. Not sure if Rust does something similar, but C# is definitely coloured.
- dathinab 6y ago> but C# is definitely coloured. And so is Rust and IMHO any language (Go is mono red ;) ). The more relevant take away is that not all drawbacks associated with coloring does apply to all languages equally. IMHO the only constant about coloring is that calling functions of different color is somewhat harder then calling the same color (but how much depends on language). This also means if your language default to blue/red then red/blue is likely to be generally slightly harder to use.