Is there any point in doing this?
public static void Write<T>(T value)
{
textWriter.Write(value.ToString());
}
...as supposed to this:
public static void Write(object value)
{
textWriter.Write(value.ToString());
}
Setting aside the obvious null dereference possibility, If I where to write a lot of value types using this method wouldn't the former be much better because it will have it's own version of the write method to call, or is it just gonna bloat the binary in terms of a lot of additional code being generated?
The performance implication of such a thing might be negligible, but I'm curious, it's a lot more compact than providing an overload for each and every value type in the BCL, like most writers in the BCL already do.