The one operator I want to see in C#: ?.

As Eric Lippert published the April Fool post for new operators –> and <– in C#, the old idea of ?. came back to me. The dilemma I’ve been considering this for some time, and I’m half-serious when suggesting this. C# already has the great null coalescing operator ?? that allows me to treat nulls […]

April 5, 2010 · Jouni Heikniemi · 5 Comments
Tags:  · Posted in: .NET

What’s new in .NET 4.0? (in Finnish)

Just a quick heads-up for my countrymen reading this: I have written and published an 18-page white paper on “What’s new in .NET 4.0” (including changes in C# 4.0 and Visual Basic 2010). Unfortunately for the international audience, the article is written in Finnish. Available on the ITpro.fi web site. Enjoy!

December 4, 2009 · Jouni Heikniemi · 3 Comments
Tags: , ,  · Posted in: .NET

Collection initialization is not construction

The ability to initialize collections is a great feature of C# 3.0, but it may not work exactly as you expected. Consider the following class: internal class MyListContainer { internal List<object> MyObjects { get; set; } } Now, imagine a call site that does the following: MyListContainer mlc = new MyListContainer { MyObjects = { […]

September 16, 2009 · Jouni Heikniemi · No Comments
Tags:  · Posted in: .NET

Why should you attack incorrect parameter name casing now?

Who cares if your C# method parameters are called “int customerId”, “int CustomerID” or whatever? Well, soon you will! For the short history of C#, method parameter names have been like private variables to C# developers: Their names don’t make a difference and can be changed at any time. Yet technically, changing method argument names […]

September 7, 2009 · Jouni Heikniemi · No Comments
Tags: ,  · Posted in: .NET

C# partial methods to the limelight!

C# 2.0 and Visual Studio 2005 introduced partial classes to the C# language. In the same rush partial methods appeared, but they have been far less heard of. What’s with those? Background: Partial classes Partial classes are a big part of the background for partial methods, so a short recap is in order. Skip to […]

July 6, 2009 · Jouni Heikniemi · No Comments
Tags: , ,  · Posted in: .NET