Friday, October 29, 2010

[PDC – Visual C# 5.0] Asynchronous Programming (async / await)

Anders Heijlsberg presented the future features and extensions of the next release of Visual C# 5.0 during his PDC talk.

The most interesting feature is the new approach to asynchronous programming. Today it is possible but not always very easy to go fully asynchronous. Developers have to write complex code that gets quickly very ugly and incomprehensional.

This is going to change in the future. The next version of Visual C# will get new keywords (async / await) that greatly help to simplify asynchronous programming.

Developers will write their code in a synchronous approach (nothing will change at all). And they will be able to make the code asynchronous just by using the “async” and “await” keywords in the right places.The rest in abstracted out from the programmer.

As it was already done in the Parallel Programming approach, the goal of Microsoft is to keep Asynchronous Programming as simple as possible. Developers may concentrate on added business value and not the environment. These new language features will make C# and .NET even more beginner friendly and will help developers to be much more productive.

You can download the CTP version that you can use for R&D and testing here.

MSDN page that fully explains the new async features :


[Information] Free Ebook on Windows Phone 7 Programming

Get this free eBook on Windows Phone 7 programming written by Charles Petzold and published by Microsoft Press. It contains 24 chapters and around 1000 pages that will help you build Windows Phone 7 application fast. This is an exclusive possibility to learn how to program for the new version of Windows Phone.


Get the PDF here. And the code samples here.


Tuesday, October 19, 2010

[Tutorial] S.O.L.I.D. quality code in C#
Part1: Principles of coding

After multiple years of experience in the software development sector it becomes clear that the principles of object oriented programming are often misused, not correctly applied or simply just ignored by many developers.

Even if the basics seem to be easy, there are often big problems in their realization which may lead to:

  • Bugs
  • Bad code structure
  • Unmaintainable code
  • Bad performance
  • Code that is just not understandable

The S.O.L.I.D. design principles that help to prevent all of these problems and allow the writing of high quality code are:

  • Single Responsibility Principle
  • Open-Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle

I am going to present and explain each of these principles in detail. I am also going to show examples in C# that will help you to understand how to apply them in your code.