Why I (Still) Won't Use D

renoX renosky at free.fr
Fri Mar 28 09:58:36 PDT 2008


Vladimir Panteleev Wrote:

> On Thu, 27 Mar 2008 19:26:35 +0200, Benji Smith <benji at benjismith.net> wrote:
> 
> > STRINGS
> >
> > The existence of three different string types (six, if you count
> > const/mutable variations of each) makes text-processing more difficult
> > than it ought to be.
> 
> I don't think this is suitable for a high-performance, Unicode-ready, system programming language. UTF-8 is used most commonly as it's the most space-efficient; UTF-16 is good for OSes which use it or wide strings (e.g. Windows NT); UTF-32 is used where quick indexing is required. Having a "black box" string type which does all these conversions "on-demand" does not fit in with D, IMO.


I disagree: D is all about balancing developers productivity with performance, if you want the highest performance use C.
Here I think that a string class which would default to UTF-8 on Linux and UTF-16 on Windows as it fits the OS choice would be the most 'D-like' solution, with of course other classes string-8, string16, string-32 (don't care about the name) if you need to specify the UTF variant of your strings.

This string class would provide "efficient portability" of D programs by default.

renoX





More information about the Digitalmars-d mailing list