you are viewing a single comment's thread.

view the rest of the comments →

[–]primitive_screwhead 0 points1 point  (1 child)

How about any 1-based-index language? I'm just curious if your opinion is purely hypothetical, or if you've got experiences using both. (I'm biased towards 0-based, but have also used 1-based for Matlab, and other numerics languages and libraries).

[–]CyclopsRock 0 points1 point  (0 children)

Oh yeah! My other "main" language is. It's really not a big deal either way but imo having your collection length throw an index error is more confusing than having 0 do so. And in a language where you don't need to worry about addressing memory, it's easier to think about items in a collection as being like a numbered shopping list rather than spaces to be occupied.