Rant: Date and Time fall short of simplicity in D

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Mar 29 23:54:20 PDT 2013


On 3/29/13, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> Thread.sleep(1.seconds + 200.msecs + 800.usecs);

Heh, sweet UFCS! Funny thing about this is my editor thinks "seconds"
is a fractional part and is syntax-highlighting it as a floating-point
number. Oops! :p

> 3. I HATE "safe" cast conversions.  If you want to make a conversion, use
> a method/property.  I don't even know why D allows overloading casting.
> Casts are way too blunt for this.

Totally agreed. Because casts can be both defined and a blunt tool you
can never be sure you're actually calling a conversion method. It
could even be removed in a library between version releases,
potentially turning your casts unsafe.


More information about the Digitalmars-d mailing list