Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I 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.


For sure, I switch between python, C/C++ an julia a lot and well, lets say bounds errors are pretty common for me.


The "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.


My advice would be to use begin and end. Then you don't have to think about the indexing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: