# OffsetArrays, inbounds, and confusion

**URL:** <https://discourse.julialang.org/t/offsetarrays-inbounds-and-confusion/81295>\
**Category:** Internals & Design\
**Tags:** indexing, arrays\
**Created:** [May 19, 2022, 3:50am UTC](https://discourse.julialang.org/t/offsetarrays-inbounds-and-confusion/81295 "2022-05-19T03:50:46Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![JohnnyChen94](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnnychen94/32/29979_2.png) [@JohnnyChen94](https://discourse.julialang.org/u/JohnnyChen94)\
**Post date:** [May 19, 2022, 3:13pm UTC](https://discourse.julialang.org/t/offsetarrays-inbounds-and-confusion/81295/23 "2022-05-19T15:13:41Z")

</div>

It seems to me that a big confusion among the community is that people are worried that every function should support custom axes and it will take a lot of efforts to correct the implementations. No, there are many valid reasons to not support offset arrays.

If the function does not plan to support offset arrays, add `Base.require_one_based_indexing` as an eager check is sufficient enough to tell your package users they should use “standard” arrays.

You don’t need to [add “this-package-support-offset-arrays” badges](https://discourse.julialang.org/t/badge-for-generic-safe-offsetarray-safe-packages/81270), you don’t need heavy documentation, just do more checks, and when you do support generic arrays, write more tests. Eventually, it is the test that gaurentees correctness in the long run.

---

_[View the full topic](https://discourse.julialang.org/t/offsetarrays-inbounds-and-confusion/81295)._
