How much can hard-coded indexing be avoided in Julia?

I did not say it in the exact post I linked above, but three posts below, and the the context is:

But yes, I would like to believe that given time (and that nothing changes in Base) more and more people will adopt one of that three alternatives (given their specific use). If you use only values, there really no reason to not go with just for element in collection; use only indexes? go with for index in eachindex(collection); use both indexes and values? for (index, element) in pairs(collection). There can be exceptions given some particular characteristics of your loop, but these should be considered the default in the mentioned circumnstances.

2 Likes