You’ve probably heard it before: “Exceptions are expensive!” Maybe if you’re like me, you heard it but you didn’t believe it, not really. How bad could they be? Well, I was recently forced face-to-face with the reality of this saying, and I’m here to tell you, exceptions are expensive!
In my case, I was using a generic helper method that called Convert.ChangeType(). This method can throw, among other things, a FormatException if the input object is not in a format that can be converted to the requested type. Unfortunately, this particular class does not provide a way to check whether ...