2 ms·
Which makes sense that it's offset for C, but higher level languages like Python, JS, etc should be index based, which would be 1. That's where R, Julia, Matlab
by goatlover 10y ago
Which makes sense that it's offset for C, but higher level languages like Python, JS, etc should be index based, which would be 1. That's where R, Julia, Matlab get it right.
- waynecochran 10y agoActually Niklaus Wirth did the best thing a long time ago with Pascal ... let the programmer decide the index range for arrays (although he screwed up making the size of the array part of the type). K&R made the best decision for C since it is the most transparent for the hardware.