On Sun, 21 Nov 2010 03:17:57 -0800
Jonathan M Davis <[email protected]> wrote:

> You're not losing _anything_ out of the deal except that you wouldn't do 
> obj.toString(). Instead you'd do to!string(obj).

I'm usually not using toString(), it's supported by the language. What about 
format("%s:%s", a,b)? Will it still call toString implicitely, or writeTo a 
buffer, or what else?

Anyway, I cannot see any advantage in deprecating toString() for every 
programmer in every use case, just for hypothetical efficiency issues -- that 
have not yet been shown in concrete cases: an app that cannot work fine because 
of toString allocating on the heap. Let us free to use our favorite tools, 
please! Do not pretend & telling us what is best for us.
The solution is simple: toString() defaults to writeTo, writeTo defaults to 
toString. This also solves 2 "human" issue you evoke: that people are used to 
toString and know it very well, and that writeTo looks more intimidating.

As said in previous post, enhancing toString with a format specifier would be 
cool.

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com

Reply via email to