News for hackers. Stuff that matters.
Re:Why Python uses 0-based indexing. It's because of slices by IanCal on Thursday October 24, 2013 @03:58AM (#6603894)
Premise 4: Your type system can't tell the difference between "null" and 0.

Adding 4 and null also makes no sense, yet 4 + 0 is perfectly fine.

> Conclusion: Null indexes that are architecturally invalid to use are a good thing, because you can catch bugs involving their use immediately.

Recommendation: Have a good type system.

    >>> a = [1]
    >>> a[None]
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers, not NoneType

There are no comments on this comment yet.