• lefixxx@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    9
    ·
    11 hours ago

    How is arrays starting at 1 still a controversial take. Arrays should start at 1 and offsets at 0.

    • Traister101@lemmy.today
      link
      fedilink
      arrow-up
      3
      ·
      10 hours ago

      So what’s 0 do then? I’m okay with wacky indexes (I’ve used something with negative indexes for a end-index shorthand) but 0 has to mean something that’s actually useful. Using the index as the offset into the array seems to be the most useful way to index them.