Last post Nov 18, 2017 07:46 PM by PatriceSc
Nov 18, 2017 07:24 PM|ashvinvee|LINK
I am new to asynchronous programming. I understand Async Await and AsyncCallback (Delegates) are used to call methods asynchronously.
I would like to know the real difference between the two. Can someone help me in understanding the difference.
Thanks in advance,
Nov 18, 2017 07:46 PM|PatriceSc|LINK
AFAIK the idea is to just make asynchronous programming easier. With async/await your code looks like synchronous code. With callbacks if you start for example to trigger another async operation from your callback, it will become quite soon hard to follow.
Try to write the same code using both approach.
Edit: you have a quick comparison at
https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/ which also explicitely state that async/await is the recommended approach.