9
natan
8y

Should array indexes begin with 0 or with 1?

To end this discussion I propose they begin with 0.5.

Comments
  • 4
    How about -1 just to flip everyone off
  • 0
    It's kind of logical that with 0. Like 0 items before this item in an array (i[0]), 1 item before this item and so on.
  • 3
  • 2
    Even better:
    Index every array with a floting point number between 0 and 1, where 0 is the first item and 1 is the last. The items in between would have an index proportional to their position. E.g. Indices for [1, 2, 3, 4, 5, 6] would be:
    0,
    0,1666666667
    0,3333333333
    0,5
    0,6666666667
    0,8333333333
    1

    And imagine when you loose precision with a larger array...
    This is just pure evil 😈
  • 2
    We should index them with the index items related fibonacci number^-1

    For example
    0 -> 1/1
    3 -> 1/5
    5 -> 1/13
  • 0
    Golden ratio??
Add Comment