Skip navigation

Monthly Archives: February 2008

This is a rant.  A brief rant.

How can any intelligent software developer think that throwing an exception when a key is not found with the [] operator is a good idea?

Come on.  The correct behavior should be that it simply returns null like every other collections API before (and hopefully after).

I should not have to write code like this:

object o = null; 

if (dictionary.ContainsKey(key) == true)  { o = dictionary[key]; }