Why I (Still) Won't Use D

Michiel Helvensteijn nomail at please.com
Thu Mar 27 16:26:59 PDT 2008


Walter Bright wrote:

>>> making for 18 character types! Next, we have char[], vector<char>, and
>>> string<char>, making for 54 string types, more than half of which are
>>> implementation defined.
>> 
>> vector<char> is a silly example and you know it. You could have made your
>> point just fine with only 36 string types. :-)
> 
> No, I don't agree that it is a silly example.

No one ever used vector<char> as a string and no one ever will.

> Why is a string *fundamentally* different from an array? I believe it is a
> serious mistake to have both. 

I agree. I like the D approach to strings a lot better than the C++
approach, as I said in another subthread.

> I did throw a bone, though, by leaving off valarray<char> :-)

Why not mention list<char> and deque<char> while you're at it? :-)

>> I have to agree that C++ has a lot of baggage because of its backward
>> compatibility. It is its greatest strength and its greatest weakness.
> 
> True, but that offers no reason to use C++ for new projects. Try writing
> an internationalized string processing app in C++, and you're in for
> endless pain and bugs.

There are toolkits like Qt that will make it a lot easier. Of course, the Qt
toolkit does this by introducing yet another string type. ;-)

-- 
Michiel




More information about the Digitalmars-d mailing list