Implicit enum conversions are a stupid PITA

Nick Sabalausky a at a.a
Thu Mar 25 19:52:20 PDT 2010


"bearophile" <bearophileHUGS at lycos.com> wrote in message 
news:hoh07b$16km$1 at digitalmars.com...
> Walter Bright:
>
>>Yes, we can endlessly rename keywords, but in the end, what does that 
>>accomplish that would compensate for upending every D program in 
>>existence?<
>
> I can list few pro/cons, but then the decision is not mine.
>
> The wchar/dchar are short names, easy to write, but for me and a person 
> I've shown/taught D it doesn't result easy to remember their size in 
> bytes. "w" stands for wide, "d" for double, this is easy to remember. But 
> how wide is wide? That's why I have suggested to adopt more descriptive 
> names for them.
>
> A way to invent descriptive names is to use names similar to the 
> byte/shot/int/long integers. Or to use numbers after the "char". I guess 
> now it can be too much late to change type names...
>

As long as we're bikeshedding on type names, I do find it misleading that 
"char" represents a code-unit while still calling itself a "character". 
Don't get me wrong, I don't mind that at the language level D operates on 
code-units instead of code-points (Tango and Phobos2 have pretty darned good 
handling of code-points anyway). It's just that ever since learning how 
Unicode works, it seems rather a misleading misnomer to call a code-unit 
"char". I can live with it, of course, now that I know, but I don't envy the 
newbies who may come across it. 





More information about the Digitalmars-d mailing list