Avoiding the NullReferenceException
Easily, by a landslide, the most common exception I’ve run into in C# is the NullReferenceException. Second would be an InvalidOperationException. But NullReferenceException wins as most occurred exception hands down. This quick post shows how we can start avoiding the NullReferenceException. I despise null. I despise null checks. What if there was a way to get rid of null checks? Luckily there is. Last year I was at a talk by Reid Evans, Getting Started with Functional Programming in F#. He touched on it and I’ve been using an implementation in C# ever since. Option an option type or maybe type is a polymorphic type that represents… Read More »Avoiding the NullReferenceException