Patronizing Language Design?
Leandro Lucarella
llucax at gmail.com
Mon Jul 20 07:18:59 PDT 2009
Don, el 20 de julio a las 11:24 me escribiste:
> Walter Bright wrote:
> >For example (back to aircraft!), dust covers and other things that are handy to
> >stick on the aircraft while on the ground, but would screw things up while in
> >flight, have long red streamers attached. This makes it easy & quick to scan
> >for any (literally) red flags before takeoff.
>
> We still have a problem with casting, I think. There are still too many places
> where it is required. Most of the time they are pretty harmless, but
> unfortunately cast() can also be used to do some really nasty stuff.
> eg,
> int a = cast(int)b;
> If b is 'uint', that's fine. But if b is immutable, or an object, that's a
> disgusting bit of code. And you can't whether it's harmless or a capital offence
> without looking at the definition of b. Another example of long-distance
> coupling.
I was thinking the same the other day. I think common conversions should
be handled by library functions, not casts. Specially conversions where
there is more work than telling the compiler to interpret the bits in
another way.
--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Home, home again.
I like to be here when I can.
When I come home cold and tired
It's good to warm my bones beside the fire.
More information about the Digitalmars-d
mailing list