Re:Julia Language Co-Creators Win James H. Wilkinson Prize f...
by Tarq0n on Wednesday January 23, 2019 @12:12PM
(#18980144)
Ok, but why should that influence a managed language with no pointers?
Re:Julia Language Co-Creators Win James H. Wilkinson Prize f...
by giornogiovanna on Wednesday January 23, 2019 @12:30PM
(#18980341)
It shouldn't. One-based indexing is what all the research uses, so it is undeniably the better choice for Julia. But zero-based indexing isn't just a memory trick, it makes lots of math easier when you're concatenating ranges or slicing arrays or doing modular arithmetic anywhere near an array.
if you have array [a,b,c,d] array[0] is a which in computer is logical. why? because it stored in memory 'abcd' (forgetting endianness for sake of argument...) and the offset from the base pointer to a is 0. so it makes perfect sense for arrays to start at 0, as there is no offset from the base... there is not 1 item offset from the base :s if you find it confusing i would say learn how computers actually operate instead of arguing from some theoretical frame of mind which has nothing to do with how computers work. a computer isn't mathematics or some arithmetic machine.
just because arithmetic is safer without 0 doesn't mean it's logical for a computer to suddenly have different array indexing. array indexing on a computer has nothing to do with maths. just memory layout and pointers...
#addsfueltofire