Who here uses IDictionary classes in their projects? Raise your hand. Keep your hand up if you cannot bear the sight of having to call another ContainsKey method. Keep it up if you cry at the idea of having to use the “out” keyword in conjunction with the TryGetValue method... Keep the hand up if you consider that removing items should be allowed from inside a foreach loop. Is your hand still up? Yeah, mine too . Alright let’s all take a break. This is just one of the numerous annoying little things ......
One of the most common question people ask me in the teams I’m in is the following: Where should I put Try – Catch blocks? The second most popular is equally challenging: What is the best method to re-throw an exception? This post will try to answer both questions. Before I start with this topic, I must warn you that the following is not the official “best practices” but rather my own personal opinion on the subject, based on my past experience. I think that Try – Catch blocks are a great asset of ......
Serialization is a beautiful thing. Now that was a geeky comment.... Jokes aside, it is. Standard .NET serialization is quite simple. Tag your class with the [Serializable()] attribute, make sure all your state variables are serializable and voila. But what if some of these variables aren’t serializable? Then you simply need to tag those variables as [NonSerializable()] and then you are really done. Of course I could get into the details of all this but this post isn’t about standard .NET serialization. ......
Last monday (oct 5th) I gave a presentation for the Montreal .NET Community. There where two subjects, the first one was called "watch your stack traces!!" and the second was "Can you speak modern .NET?". In case someone from the presentation wants the code I prensented, (sorry all comments are in french) I'm seriously searching a way to get this zip file up here somewhere... Until then you can reach me at vgrondin @ hotmail dot com and I'll be glad to sent it to you. Thanks for the how to D'Arcy ......