Honest question, is it that hard to just adjust to 1-indexing? I switch languages all the time and they all have their different quirks and I find it really hard to understand why people cannot deal with for example 1-indexing. From the outside looking in it seems like one of the easier things to adjust to?
It's intuitive to me that the option "c) 2 ≤ i ≤ 12" is the only acceptable answer, since it is the only range you can tell immediately at a glance what numbers are included: 2, ..., 12. There shouldn't be a 1 or a 13 in the notation if there won't be a 1 or a 13 in the sequence it's describing -- it's just bad design.
If you select the option "c) 2 ≤ i ≤ 12", then Dijkstra's subsequent argument for zero-indexing becomes an argument for one-indexing, because a sequence of length N yields the range 1 <= i <= N when subscripting with 1, but 0 <= i <= N-1 when starting at 0. The latter is uglier than the former.
My personal experience using Lua/love2d for some (amateur/hobbyist) game programming is that the adjustment really wasn't too difficult at all -- I've run into an off-by-one error or two, but not at any greater (or reduced) frequency compared to 0-indexed languages AFAICT. Obviously, some of the sibling comments here disagree, so the only reasonable conclusion I can draw is that it varies from person to person how much they care and how much effort it takes to adjust.
At the end of the day, like all language design decisions involving an arbitrary choice among reasonable options, you get used to it once you use the language enough (and also some folks will refuse to ever use the language because of it for aesthetic reasons).
I've used many languages, and I don't have much problem with any quirks or major differences (Haskell, JavaScript, ...). The only language I've bounced off of is Prolog, and I'm planning another attempt.
But I've done a lot of low level programming, and 0-based arrays are a no-brainer to deal with. Switching to 1-based arrays throws out all of my intuitions and makes me have to recalculate everything, which is error-prone.
Yes. It looks wrong and feels wrong. I can adjust to indentation styles, programming styles, etc. but 1-based indexing is an absolute deal-breaker for me. It's one of the few things the programming community has settled on - indexing starts at 0, as it is mathematically the most natural start.
If you are counting, 1-based makes a lot of sense. If you're indexing, they're equally valid approaches. However, if you're indexing then you should be able to use an arbitrary range and not be restricted to one or the other (with a mapping function from your actual range to the language's base).
In Sweden, the set usually referred to as "de naturliga talen" (the natural numbers) is any number n such that 0 <= n.
Or, at least, that was the case when I did maths there. No idea what the default interpretation is these days.
This is mostly why I don't say "natural numbers" and instead say "positive integers" or "non-negative integers", depending on if I want 0 included or not.
Honestly, not that many people in math think about the construction of the natural numbers frequently. Yeah, we learn about it of course, but that's about it. Very often the natural numbers do not include 0. Often they do. I've seen $\mathbb Z_{\geq0}$ and $\mathbb Z_+$ used to avoid having to worry about it.
Hell, different countries can't even agree on whether 0 is positive. In France, 0 is considered both positive and negative. In USA, 0 is considered neither.
(quick edit: I realize my last paragraph makes the $\mathbb Z_+$ option seem weird. I do math in the States.)
Only if you need zero, which you don't need for indexing. Peano's original axioms started from 1 (which is logically equivalent to starting from 0, or -1, or potato) if all you are doing is counting)
It is a pain, yes, after decades of 0-indexed languages! I switched to mostly-Julia from mostly-C in the last year, and the 1-indexing is the main irritating thing. I have to learn different ways of doing things, which I guess I haven't yet, so the parts in my programs dealing with 1-indexing seem cumbersome and fiddly, every time. 0-indexing just seems mathematically much simpler. And I like things making things as simple as possible. Maybe as I learn different habits, that impression will go away.
It's also about the only thing I really don't like about Julia – so I can understand someone saying 1-indexing is a deal-breaker.
> Maybe as I learn different habits, that impression will go away.
I'd bet this is true. It doesn't seem fiddly to me as a mathematician. Thinking habits can be really hard to get past though, so I also understand people not liking 1-based. I just think the argument from math is wrong.