On Wednesday, 14 February 2024 at 00:56:21 UTC, Kevin Bailey
wrote:
Personally, I don't have a problem with .length being unsigned.
How do you have a negative length? My problem is that the
language doesn't correctly compare signed and unsigned.
The length itself is technically the index of a non-existing
element right after the array. And -1 is technically the index of
a non-existing element right before the array. Hence just
mechanically reversing the direction of processing array elements
during refactoring may be potentially dangerous if one is not
careful enough.