'int' is enough for 'length' to migrate code from x86 to x64

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 19 17:03:48 PST 2014


On Thu, Nov 20, 2014 at 01:00:00AM +0000, flamencofantasy via Digitalmars-d wrote:
> On Wednesday, 19 November 2014 at 20:38:15 UTC, bearophile wrote:
[...]
> >Yet, experience in D has shown very well that having unsigned lengths
> >is the wrong design choice. It's a D wart.
> >
> >Bye,
> >bearophile
> 
> Yet, MY experience in D has shown very well that having unsigned
> lengths is the RIGHT design choice. It's NOT a D wart.
[...]

I concur.

However, the fact that you can freely mix signed and unsigned types in
unsafe ways without any warning, is a fly that spoils the soup.

If this kind of unsafe mixing wasn't allowed, or required explict casts
(to signify "yes I know what I'm doing and I'm prepared to face the
consequences"), I suspect that bearophile would be much happier about
this issue. ;-)


T

-- 
MAS = Mana Ada Sistem?


More information about the Digitalmars-d mailing list