# Is OffsetArrays.jl a poison pill?

**URL:** <https://discourse.julialang.org/t/is-offsetarrays-jl-a-poison-pill/85188>\
**Category:** Internals & Design\
**Created:** [August 2, 2022, 7:22pm UTC](https://discourse.julialang.org/t/is-offsetarrays-jl-a-poison-pill/85188 "2022-08-02T19:22:53Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [August 3, 2022, 12:53am UTC](https://discourse.julialang.org/t/is-offsetarrays-jl-a-poison-pill/85188/14 "2022-08-03T00:53:27Z")

</div>

> [@pdeffebach](#):
>
> If you are an end-user, you are free to do `1:length(x)` whenever you want.

But usually when a newcomer asks about this, the response is “don’t do `1:length(x)` or the world will come to an end.” The same holds for other best practices. We could be more nuanced when answering these questions.

> [@Best practices](https://discourse.julialang.org/t/best-practices/85138):
>
> I am running a code which is diagonalizing very large matrices, hence I need to reach the best possible performance. when scanning a vector I was using the following syntax for i in 1:length(vec) which works fine. However, I am recently receiving the following warning Indexing with indices obtained from length, size etc is discouraged. Use eachindex or axes instead. Is it just a good practice? or the performance is also affected?

---

_[View the full topic](https://discourse.julialang.org/t/is-offsetarrays-jl-a-poison-pill/85188)._
