digitalmars.D - toString vs toUtf8???
- davidl (15/15) Dec 16 2007 I really don't get why there was an argument about it.
- Jarrett Billingsley (2/15) Dec 16 2007 What?
- Gregor Richards (3/23) Dec 16 2007 Second.
- Alexander Panek (5/26) Dec 16 2007 no u!
- Paul Findlay (2/3) Dec 16 2007 Haha, obviously?
- Sean Kelly (6/10) Dec 17 2007 How so? If someone wants to return a string using a different encoding,...
I really don't get why there was an argument about it. Obviously tango team chose a bad name. toUtf8 has nothing to do with enforcing a string to utf8 encoded. Thus, toUtf8 is misleading. And as a library API , the design goal is to make each API simple. And design is a process of solving problems. While solving problems needs to decompose. It's a common sense to decompose problems. But why when we come to this toString and toUtf8, we forget to decompose?? Decompose toUtf8 -> we get toString -> Encode_String_Utf8 Someone might argue toString is too long to type. But toStr is even shorter than toUtf8 -- 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
Dec 16 2007
"davidl" <davidl 126.com> wrote in message news:op.t3gmbbugeb62bo lzg...I really don't get why there was an argument about it. Obviously tango team chose a bad name. toUtf8 has nothing to do with enforcing a string to utf8 encoded. Thus, toUtf8 is misleading. And as a library API , the design goal is to make each API simple. And design is a process of solving problems. While solving problems needs to decompose. It's a common sense to decompose problems. But why when we come to this toString and toUtf8, we forget to decompose?? Decompose toUtf8 -> we get toString -> Encode_String_Utf8 Someone might argue toString is too long to type. But toStr is even shorter than toUtf8What?
Dec 16 2007
Jarrett Billingsley wrote:"davidl" <davidl 126.com> wrote in message news:op.t3gmbbugeb62bo lzg...Second. - Gregor RichardsI really don't get why there was an argument about it. Obviously tango team chose a bad name. toUtf8 has nothing to do with enforcing a string to utf8 encoded. Thus, toUtf8 is misleading. And as a library API , the design goal is to make each API simple. And design is a process of solving problems. While solving problems needs to decompose. It's a common sense to decompose problems. But why when we come to this toString and toUtf8, we forget to decompose?? Decompose toUtf8 -> we get toString -> Encode_String_Utf8 Someone might argue toString is too long to type. But toStr is even shorter than toUtf8What?
Dec 16 2007
On Sun, 16 Dec 2007 23:09:19 -0500 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote:"davidl" <davidl 126.com> wrote in message news:op.t3gmbbugeb62bo lzg...no u! -- Alexander Panek <alexander.panek brainsware.org>I really don't get why there was an argument about it. Obviously tango team chose a bad name. toUtf8 has nothing to do with enforcing a string to utf8 encoded. Thus, toUtf8 is misleading. And as a library API , the design goal is to make each API simple. And design is a process of solving problems. While solving problems needs to decompose. It's a common sense to decompose problems. But why when we come to this toString and toUtf8, we forget to decompose?? Decompose toUtf8 -> we get toString -> Encode_String_Utf8 Someone might argue toString is too long to type. But toStr is even shorter than toUtf8What?
Dec 16 2007
davidl wrote:Obviously tango team chose a bad name.Haha, obviously?
Dec 16 2007
davidl wrote:I really don't get why there was an argument about it. Obviously tango team chose a bad name. toUtf8 has nothing to do with enforcing a string to utf8 encoded. Thus, toUtf8 is misleading.How so? If someone wants to return a string using a different encoding, they can use a different function name. Given that D has "standardized" on Unicode, I think it's a fair assertion that the default encoding should be Unicode. Sean
Dec 17 2007