Robert Jacques wrote:
The new rules are definitely an improvement over C, but they make byte/ubyte/short/ushort second class citizens, because practically every assignment requires a cast:
byte a,b,c;
c = cast(byte) a + b;

They've always been second class citizens, as their types keep getting promoted to int. They've been second class on the x86 CPUs, too, as short operations tend to be markedly slower than the corresponding int operations.

And if it weren't for compatibility issues, it would almost be worth it to remove them completely.

Shorts and bytes are very useful in arrays and data structures, but aren't worth much as local variables. If I see a:

    short s;

as a local, it always raises an eyebrow with me that there's a lurking bug.

Reply via email to