This seems like a pretty bad plan. If users of a type need data, then this type must expose methods to return this data. Why do people analyze the string representation of an object when they have access to the object?
There are, of course, serialization scripts, but they are well defined and rarely use .ToString() to do their job.
If a textual representation of the string for non-output purposes is necessary, I would prefer a separate method (which may or may not use ToString() to do its job.) This helps consumers as well as developers; it would be very unfortunate if the new encoder wanted to add some information about the debug dump in ToString() and broke the users of the class.
UPDATE As MattDavey points out, if you implement IFormattable , then this is a good compromise: your consumers call ToString() , but given specific formats and a reliable contract for what it means. Still different from what your peers do, but an option that may be more amenable to them.
source share