Visual Studio 2008 Impressions
VS 2008 and the accompaning c# 3.0 has virtually changed the way I write code. I know that’s a lot to say about a product, but I feel that strongly about it. It has simplified my writing by exciting me to go back and look at how I write code.
I’ll start with Lambda Expressions because they have made the most difference in my code. For those who need a starter course, a good article on them is here. What I love about them is ability to create action functions with them. An example would be the following:
_listofWidgits.ForEach(t =>
{
//Do something to each widgit.
}
No defining some method, just do it. Another alternative would be to define a method that takes a widgit as the only parameter and phrase it as follows:
_listofWidgits.ForEach(SomeMethod); //No need to spell out the fact that you are passing a widgit to the method. Intellisense does it for you.
How’s that for shortening your code. Anyway, I’ll talk more about LINQ and c# 3.o soon.
No comments yet. Be the first.
Leave a reply