Type inference in C# 3.0

Published Sat, Apr 26 2008 11:54

My friend Paulo published a post that talks about type inference and how it might evolve in the next years. Even though type inference's main objective is to support LINQ (in fact, most of the new stuff that C#3.0 introduced is only there to support LINQ), I must say that I've been enjoying it a lot and I've been using it whenever possible. Initially, I wasn't really into using var because I thought that it would reduce the readability of my code and I've only started using it after installing one of the nightly builds of R#. In fact, I was one of the first to complain on the R# forums about it.

Anyway, I decided to give it a try and guess what? I've noticed that using this approach will not reduce my code readability. In fact, I've noticed an improvement on my local variables' names. I know that this might look really strange at first, but believe me: give it a try and I bet you'll end up loving it (and let me tell you that this is helping my with my carpal tunnel syndrome :))

Filed under: ,

Leave a Comment

If you can't read this number refresh your screen
Enter the numbers above:  


This Blog





Email Notifications


  • View Luis Abreu's profile on LinkedIn

    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover