News for hackers. Stuff that matters.
Re:Numbering should start at zero: E.W. Dijkstra by venusenvy47 on Friday March 21, 2025 @09:55AM (#43435752)
Just speaking anecdotally, I had the impression that math people prefer 1-based indexing. I've heard that Matlab is 1-based because it was written by math majors, rather than CS majors.
Re:Numbering should start at zero: E.W. Dijkstra by Aardwolf on Friday March 21, 2025 @10:25AM (#43436085)
Yes but I think it might be just habit, and it's exactly in matlab that dealing with for loops over sub matrices is so annoying due to this
Re:Numbering should start at zero: E.W. Dijkstra by BeetleB on Friday March 21, 2025 @01:05PM (#43438234)
Indeed. I was going to point out that mathematicians choose the index based on whatever is convenient for their problem. It could begin at -3, 2, or whatever. I've never heard a mathematician complain that another mathematician is using the "wrong" index. That's something only programmers seem to do.