3 ms·
While people discuss a lot about it, in the end 1 indexing doesn't really matter. I think it comes from fortran/matlab.
by borodi 5y ago
While people discuss a lot about it, in the end 1 indexing doesn't really matter. I think it comes from fortran/matlab.
- TOMDM 5y agoI agree, it doesn't really matter, but I've been programming long enough that I can see it being that top step that's always half an inch too tall that I'm going to stub my toe on.
- borodi 5y agoFor sure, I switch between python, C/C++ an julia a lot and well, lets say bounds errors are pretty common for me.
- oscardssmith 5y agoMy advice would be to use begin and end. Then you don't have to think about the indexing.
- snicker7 5y agoThe "idiomatic" way to access the first element in an array/sequence in julia is to use the `first` function, e.g. `first(arr)` vs. `arr[1]`. This works across a larger number of array types, including OffsetArrays with 0-based index offsets.