I’ve been using the Visual Studio (VS) Developer Preview a lot lately and while there is no doubt that some items may change when this gets to the Release To Manufacturing (RTM) stage, it’s clear that from the new Team Foundation Server (TFS) advances to the new language enhancements, there’s already been a lot of work completed. One item that I’ve been focusing my attention on is asynchronous programming. I wrote a blog post about this very topic when I met with Anders Hejlsberg and I think it’s fantastic that this feature has made its way into VS. I’ll take a quick segue to promote a recent talk that Anders gave at Build 2011: Future directions for C# and Visual Basic. If you’re a person who’s using either C# or VB then this is a session you’ll surely not want to miss.
OK, back on topic, having the ability to debug an asynchronous process in the same fashion as a standard function call provides the ability to understand the flow more clearly. This not only saves time reading and creating code (eliminating the necessity of writing callback functions) but more importantly helps you create a more responsive application. And as any developer knows, a responsive application is definitely what a user wants to use.
In just a few minutes I put together a sample application and to say it was an easy task would be an understatement. The process is straightforward (utilizing the "Async" and "Await" keywords) and the only downside is that you’ll soon want to find areas of your application to run asynchronously so you can move this concept into reality.