cent and ucent?

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Jan 29 18:46:46 PST 2012


On Sun, Jan 29, 2012 at 06:23:33PM -0800, Walter Bright wrote:
[...]
> C has varying size for builtin types and fixed size for aliases. D is
> just the reverse - fixed builtin sizes and varying alias sizes.  My
> experience with both languages is that D's approach is far superior.

I agree. It's not perfect, but it definitely beats the C system.


> C's varying sizes makes it clumsy to write portable numeric code, and
> the varying size of wchar_t is such a disaster that it is completely
> useless - the C++11 had to come up with completely new basic types to
> support UTF.

Not to mention the totally non-commital way the specs were written about
wchar_t: it *could* be UTF-16, or it *could* be UTF-32, or it *could* be
a non-unicode encoding, we don't guarantee anything. Oh, you want
Unicode, right? Well for that you need to consult your OS-specific
documentation on how to set up 15 different environment variables, all
of which have non-commital descriptions, and any of which may or may not
switch the system into/out of unicode mode. Oh, you want a function to
guarantee unicode mode? We're sorry, that's not our department.

Yeah. Useless is just about right. It's almost as bad as certain parts
of the IPMI spec, which I had the misfortune to be given a project to
code for at my day job once.


T

-- 
Amateurs built the Ark; professionals built the Titanic.


More information about the Digitalmars-d mailing list