# Indices point between elements

DevFeed: [Indices point between elements](<https://devfeed.tech/articles/indices-point-between-elements-21936.md>)

Original publisher: [Read original article](<https://blog.nelhage.com/2015/08/indices-point-between-elements/>)

Author: Nelson Elhage

Published: 2015-07-17T09:00:00Z

Content type: tutorial

Language: en

Sources: [Nelson Elhage](<https://devfeed.tech/sources/nelson-elhage.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Python](<https://devfeed.tech/topics/python.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>)

Tags: [data-structure](<https://devfeed.tech/tags/data-structure.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [python](<https://devfeed.tech/tags/python.md>)

## AI overview

This article argues for viewing array indices as positions between elements rather than labels attached to elements. It explains how this model simplifies range representation and comparison and helps prevent off-by-one errors, with examples using Python and array-like data structures.

## Source excerpt

If you're familiar with nearly any mainstream programming language, and I asked you to draw a diagram of an array, the array indices, and the array elements, odds are good you'd produce a diagram something like this: In this post, I want to persuade you to replace that image, or, at least, to augment it with an alternate view on the world. I want to argue that, rather than numbering elements of an array, it makes just as much sense, and in many cases more, to number the spaces between elements: