# What's the big deal? 0 vs 1 based indexing

**URL:** https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102
**Category:** General Usage
**Created:** [December 22, 2016, 2:20pm UTC](https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102 "2016-12-22T14:20:49Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![ThePC007](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thepc007/32/22996_2.png) [@ThePC007](https://discourse.julialang.org/u/ThePC007)
#### Post date: [March 16, 2021, 10:25pm UTC](https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102/10 "2021-03-16T22:25:45Z")

</div>

0-based indexing actually becomes very natural when you program for long enough and doesn’t use any intellectual capacity at all. In fact, when working with 1-based languages I have to constantly remind myself that they are 1-based and keep messing things up even when I’m actively thinking about it (talk about error-prone).

I think 0-based indexing makes quite a lot of sense in many scenarios, especially when dealing with algorithms and such (getting the root of an array-based binary tree works very easily by dividing by 2, but only on a 0-based array, spatial partitioning becomes easier as well, etc.), not to mention actually working with memory, where the index is really just an offset and adding a 1 to it would only serve to make things messy.

---

_[View the full topic](https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102)._
