News for hackers. Stuff that matters.
Re:Julia: A fresh approach to numerical computing by phkahler on Saturday November 08, 2014 @09:15PM (#8578841)
Arrays are indexed starting at 1. I asked about this and Jeff said it just depends which types of problems end up having to use +1 or -1. I said anything mod n is now going to have the +1 and he actually paused for quite a while. I know it's an unsolvable debate, but I thought indexing from 1 went out with Fortran. I also would have thought the math folks would prefer to start at zero.
Re:Julia: A fresh approach to numerical computing by RogerL on Saturday November 08, 2014 @10:46PM (#8579026)
Don't forget matlab starts at 1. R starts at 1. Mathematica starts at 1 by default, though you can override that for any given array.

1-based indexing is very common in mathematical software.

Re:Julia: A fresh approach to numerical computing by stan_rogers on Sunday November 09, 2014 @08:19AM (#8579835)
Indeed, zero-based indexing is sort of a ridiculous concession to the hardware (whether that be data/address line labelling by power of two or offsets from a memory location) if bit-twiddling isn't your goal. (Even binary operations don't necessarily imply bit-twiddling at the conceptual level, even if that's what's going on under the hood.) We've just become rather used to counting by calling the first thing zero (and somehow have managed to forget that we had to learn that).
Re:Julia: A fresh approach to numerical computing by Ntrails on Monday November 10, 2014 @05:53AM (#8582882)
Having started in Matlab I still regularly forget that indexes start at zero in c# and end up with errors. I feel like either option is just catering to user preference at this point, as I don't feel there's a conclusive winner logically.
Re:Julia: A fresh approach to numerical computing by one-more-minute on Sunday November 09, 2014 @07:38AM (#8579761)
For me it's less about saving characters overall and more about making things as simple as possible in the basic case.

I'd much rather have +1 scattered throughout my code (though I tend not to) than have to do -1 in my head at the repl, personally.