News for hackers. Stuff that matters.
Re:Giving up on Julia by jules on Friday May 13, 2016 @06:44PM (#11693672)
Does 1 based indexing actually matter? It does if you are doing index arithmetic for rolling your own multidimensional arrays for example, but one shouldn't do those kind of things anyway.
Re:Giving up on Julia by Fomite on Friday May 13, 2016 @07:53PM (#11693920)
One thing to keep in mind is that scientific computing languages often have people using them who are not programmers, and who will not be "rolling their own multidimensional arrays."

If they're used to R, MATLAB, or basically any statistics programming/scripting language ever, not only will they be expecting 1-based indexing, they might not even know that that's a thing they have to think about.

Re:Giving up on Julia by developer2 on Friday May 13, 2016 @11:15PM (#11694411)
>> they be expecting 1-based indexing, they might not even know that that's a thing they have to think about

The truth of the matter is that this is not a point that anyone should ever mention as either a pro or con of any language. It's simply a fact that you're going to see one or the other, and it's useless to complain about which one is present in any given language. It's a one-time discovery as to which you're working with. People try to make it out to be a debilitating factor, when in reality it's a non-issue.

Re:Giving up on Julia by bluecalm on Friday May 13, 2016 @10:55PM (#11694371)
There are tons of things which you need an index for when iterating over an array. Do something different for every 4th element but then something else if it's 16th. Keep doing something for triplets of elements unless you run into specific index which is divisible by 7, then start taking them one by one. Iterate but go 5 elements back if you encounter something in some state. There are a lot of algorithms which take advantage of array being an indexed data structure with an order and not just plain container without structure.

The problem doesn't just go away with for each style loops. Python added enumerate for this reason but it really is quite clumsy for anything more complicated (and you have to choose if it's indexing from 0 or 1 anyway).