3 ms·
Precisely the opposite reason R drove me away. R uses 1 based indexing.Seriously we should all be using Zero based indexing for all purposes.
by billfruit 9y ago
Precisely the opposite reason R drove me away. R uses 1 based indexing.Seriously we should all be using Zero based indexing for all purposes.
- peatmoss 9y agoOne can make an appeal to aesthetics, but that’s no differentiator. Or one could appeal to adherence to existing standards. Fortran is the oldest (portable) programming language and was 1-based. Or one could appeal to consistency with the problem domain. Again, math [EDIT: indices are] 1-based. Zero-based is consistent with C, but that’s about the best argument I can make for zero-based.
- DonbunEf7 9y agoMaths is zero-based. I'm not sure why you think that numbers start with one; every formulation of the integers in modern maths starts with zero.
- peatmoss 9y agoMatrices, common in statistics because of applications of linear algebra, have long maintained the convention of i,j indexes starting with one.
- dnautics 9y agoIt's not. Zero based is wise for offsets (CS) and fields where you have a zero element, and a few corner cases like factorial, but by and large any time you're enumerating an order over a nonempty set you start with one in math, because, max(indices) = |set|
- billfruit 9y agoI think Dijkstra established the case for using Zero based indexing strong enough: https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...
- baldfat 9y ago0 based was only for programming for iterations. This makes it a weird math for people. When the first column is 0 and 1 is the second column it is indeed weird and is why statistical languages are 1 based.