in reply to I prefer my indexes to start at:

I voted for '0', but only as a default. I do want the option to change it. Mathematicians usually publish algorithms using '1'. Implementing them using '0' can be challenging.
Bill

Replies are listed 'Best First'.
Re^2: I prefer my indexes to start at:
by Ratazong (Monsignor) on Sep 01, 2022 at 13:17 UTC

    Since coding in c, I got used to start with zero ... and kept it. If there are algorithms (or data interfaces) that are more convenient starting with 1, I usually keep the data on index zero empty or use it for default values, as wasting one additional element is no issue nowadays ....

    So long, Rata

Re^2: I prefer my indexes to start at:
by hippo (Archbishop) on Sep 01, 2022 at 13:11 UTC

    I can't say that I've ever read a published pure maths paper - if I did it was so long ago I have forgotten.

    OTOH, every time I have seen the Fibonacci Sequence defined it has been like this:

    • F0 = 0
    • F1 = 1
    • Fn = Fn-1 + Fn-2 (for n > 1)

    Perhaps it is the exception? I voted for zero anyway. Cardinal, not ordinal. But you are right that having the choice is good.


    🦛