ketmar:

ah, let range checking catch that.

No thanks, I prefer to not have bugs in the first place.


besides, overflows are possible with signed ints too,

From my experience in coding in D they are far more unlikely than sign-related bugs of array lengths.


so what signed length does is simply hiding the bad code.

Signed lengths avoids traps that are quite easy to fall into.


any code reviewer must ring
a bell when he sees length subtraction without prior checking,
be it signed or unsigned.

The unsigned nature of array lengths is more tricky than that. They cause troubles even if you just compare (with <) a length with a signed value.

Bye,
bearophile

Reply via email to