Hacker News new | ask | show | jobs
by chriselrod 2874 days ago
I know it is not the default, but this package has no overhead over the default arrays according to recent benchmarks, and provides 0-indexed arrays: https://github.com/JuliaArrays/OffsetArrays.jl

I confess, not being the default is a big thing. I've definitely had times where I thought "this would be easier with 0 indexed arrays", but it can then be harder to commit to adding a dependency and making that change vs just adding awkward looking "+1"s to all the indexes. Coming from math/science, there's lots of times 1-indexing makes more sense / is more familiar. It's normal there to start counting from 1, so it can be easier to translate.

1 comments

It's non uncommon in mathematics to index from zero as well.