string is rarely useful as a function argument
Jakob Ovrum
jakobovrum at gmail.com
Wed Dec 28 22:33:28 PST 2011
On Thursday, 29 December 2011 at 06:08:05 UTC, Andrei
Alexandrescu wrote:
> On 12/28/11 11:36 PM, Walter Bright wrote:
>> On 12/28/2011 8:32 PM, Adam D. Ruppe wrote:
>>> On Thursday, 29 December 2011 at 04:17:37 UTC, Andrei
>>> Alexandrescu wrote:
>>>> If we have two facilities (string and e.g. String) we've
>>>> lost. We'd
>>>> need to
>>>> slowly change the built-in string type.
>>>
>>> Have you actually tried to do it?
>>
>> I've seen the damage done in C++ with multiple string types.
>> Being able
>> to convert from one to the other doesn't help much.
>
> This.
>
> The only solution is to explain Walter no other programmer in
> the world codes UTF like him. Really. I emulate that sometimes
> (learned from him) but I see code from hundreds of people day
> in and day out - it's never like his.
>
> Once we convince him, he'll be like "ah, I see what you mean.
> Requiring .rep is awesome. Let's do it."
>
>
> Andrei
I don't think this is a problem you can solve without educating
people. They will need to know a thing or two about how UTF works
to know the performance implications of many of the "safe" ways
to handle UTF strings. Further, for much use of Unicode strings
in D you can't get away with not knowing anything anyway because
D only abstracts up to code points, not graphemes. Imagine trying
to explain to the unknowing programmer what is going on when an
algorithm function broke his grapheme and he doesn't know the
first thing about Unicode.
I'm not claiming to be an expert myself, but I believe D offers
Unicode the right way as it is.
More information about the Digitalmars-d
mailing list