2 ms·
Call it bikeshedding but I totally agree. As someone who used to use Matlab (since it was what more or less everyone else in machine learning did at the time) a
by throwaway287391 8y ago
Call it bikeshedding but I totally agree. As someone who used to use Matlab (since it was what more or less everyone else in machine learning did at the time) and was immensely relieved to switch to NumPy a few years back, I’d love to give Julia a whirl but I just can’t stomach going back to a 1 indexed language. I’m surprised nobody maintains a 0 indexed fork of Julia yet (Juli0, anyone?).
- mcabbott 8y agoIf you want to take it for a spin, challenge yourself not to write anything which cares about this. It will force you to learn the some neat features (e.g. for N-dim arrays) instead of indexing with your bare hands like you're in C. And is good style anyway, to be generic to things like https://github.com/JuliaArrays/OffsetArrays.jl https://github.com/JuliaArrays/OffsetArrays.jl
- lenticular 8y agoMath uses base 1, and so does Fortran and Matlab. While Julia is an incredibly powerful language with things like user-defined unboxed structs and homoiconicity, a key design goal is to make it easy to learn for scientists and engineers who are not professional programmers. Since the vast majority use Matlab, the one-based indexing makes sense. One-based indexing works just as well as 0-based. I've done a lot in the past in Fortran 90 and (regrettably) Matlab. Some things are very slightly harder, some things are very slightly easier. At any rate, this isn't Fortran 77. You shouldn't be fiddling around with indices much. The bigger difference IMO is Julia uses Fortran-style column-major ordering, instead of row-major like C and Python. I actually