Casting functions -- Is it a code smell?
- by Earlz
I recently began to start using functions to make casting easier on my fingers for one instance I had something like this
((Dictionary<string,string>)value).Add(foo);
and converted it to a tiny little helper function so I can do this
ToDictionary(value).Add(foo);
Is this a code smell?
(also I've marked this language agnostic even though my example is C#)