Show HN: HaxlSharp – Concurrent data fetching and request deduplication in C#
github.com
github.com
This is simply incorrect. There is a lot of FUD about this, but it doesn't make a smallest difference for a code with essential complexity of a typical CRUD app. But once you need to deal even with slightly more essential complexity, like managing a pool of connections, cancelling them, reconnecting, asynchronous code comes to the rescue, with all the callbacks and higher-order functions. Synchronous looking code cannot help with asynchronous problems, no matter how hard you try. It can only introduce additional accidental complexity. It's better to have and get used to a solid asynchronous foundation to begin with.
For more complex cases, I like to make the analogy with asynchronous code. There's a few problems with complex async code that only uses a minimal abstraction, like callbacks:
* Writing asynchronous code is error-prone
* Asynchronous code obscures our intent
* Programmers are bad at reasoning about asynchronous code
So we developed abstractions like async/await and promises, allowing us to write async code in a sequential-looking way. Unfortunately, introducing concurrency into the mix breaks this sequential abstraction, which means certain familiar problems emerge:
* Writing concurrent code is error-prone
* Concurrent code obscures our intent
* Programmers are bad at reasoning about concurrent code
Haxl attempts to reclaim this sequential abstraction, allowing us to write code that looks sequential, but is actually concurrent "behind the scenes".