Skip to content

Monthly Archives: November 2009

Make aliases an option

26-Nov-09

Do you prefer int or Int32? How about string or String? Some developers have strong preferences, others don’t care. Personally, I prefer to use the actual CLR type names (in other words I prefer Int32 and String) and since I do, I feel as though I am a second-class citizen.

Interestingly enough, it [...]

Smarter type inference with C# 4

03-Nov-09

Here is a new addition to the C# language in version 4 that doesn’t seem to be getting much attention. The type inference algorithm has become smarter and for the first time we are able to infer generic type arguments from the return types of methods in certain cases.

Consider this example that compiles in [...]

You don’t always need a lambda expression

01-Nov-09

C# 3 gave us the lambda expression and ever since we have been using them to create abstract representations of terse, anonymous functions.

While expressive and helpful, they are not always needed. Consider this example:

using System; using System.Collections.Generic; class Example { static void Main() { [...]