I like my numbering to start like my tape measure: at zero.
I like my numbering to start like my elevator panel: at zero.
Numbering should start at zero (1982)
71–80 of 309 posts
Re: Numbering should start at zero (1982)
#72Consider n real numbers a_0, ..., a_{n-1}. That's not very elegant.
but good point, remembering academic linear algebra, seeing 0..n-1 in sigma/sums notations would be not convenient
Re: Numbering should start at zero (1982)
#73Earlier quoted context omitted.
> I suppose 1-based index is more logical Why?
It's interesting how most people find learning 0-based indexes confusing, but after a few years of programming, they don't even notice how odd it is. How do you number things in real life? If you have two options, do you number them "option 0" and "option 1" or "option 1" and "option 2"? If you create a presentation with numbered bullet points, do you start numbering them from 0 or 1? 1. This is my first point 2. Thi…
Re: Numbering should start at zero (1982)
#741-based numbering is nonsense. How many years old are you when you’re born? I notice almost all defenses of 1-based indexing are purely based on arbitrary cultural factors or historical conventions, e.g. “that’s how it’s done in math”, rather than logical arguments.
> 1-based numbering is nonsense. How many years old are you when you’re born? Typically 3 months shy of 1 year, so about 0.75.
For human cultural purposes, you are 0 days old at the time and date recorded for your birth. It goes on your birth certificate. If you find a culture that celebrates conceptiondays and issues conception certificates, let me know.
Re: Numbering should start at zero (1982)
#751-based numbering is nonsense. How many years old are you when you’re born? I notice almost all defenses of 1-based indexing are purely based on arbitrary cultural factors or historical conventions, e.g. “that’s how it’s done in math”, rather than logical arguments.
> How many years old are you when you’re born? You have lived zero full years and are in the first year of your life. In most (but not all) countries the former is considered "your age". That's consistent with both zero-based and one-based indexing. Both agree on cardinal numbers (an array [1, 2] has length 2), just not on ordinal numbers (whether the 1 in that array is the "first" or "zeroth" element). > I notice al…
Re: Numbering should start at zero (1982)
#761-based numbering is nonsense. How many years old are you when you’re born? I notice almost all defenses of 1-based indexing are purely based on arbitrary cultural factors or historical conventions, e.g. “that’s how it’s done in math”, rather than logical arguments.
So if you go into a bar and order a beer, you drink the zeroth beer before the first?
Re: Numbering should start at zero (1982)
#771-based numbering is nonsense. How many years old are you when you’re born? I notice almost all defenses of 1-based indexing are purely based on arbitrary cultural factors or historical conventions, e.g. “that’s how it’s done in math”, rather than logical arguments.
Re: Numbering should start at zero (1982)
#78Earlier quoted context omitted.
> 1-based numbering is nonsense. How many years old are you when you’re born? Typically 3 months shy of 1 year, so about 0.75.
The key word in "birthday" is "birth". Not conception. For human cultural purposes, you are 0 days old at the time and date recorded for your birth. It goes on your birth certificate. If you find a culture that celebrates conceptiondays and issues conception certificates, let me know.
While that is the norm, there both are and have been cultures where you are 1 when you are born (as in you are living your first year of life).
Re: Numbering should start at zero (1982)
#79Perhaps ideally we'd change English to count the "first" entry in a sequence as the "zeroth" item, but the path dependency and the effort required to do that is rather large to say the least. At least we're not stuck with the Roman "inclusive counting" system that included one extra number in ranges* so that e.g. weeks have "8" days and Sunday is two days before Monday since Monday is itself included in the count. *…
French (and likely other Latin languages?) are not quite so lucky. "En 8" means in a week, "une quinzaine" (from 15) means two weeks...
Re: Numbering should start at zero (1982)
#80Earlier quoted context omitted.
> How many years old are you when you’re born? You have lived zero full years and are in the first year of your life. In most (but not all) countries the former is considered "your age". That's consistent with both zero-based and one-based indexing. Both agree on cardinal numbers (an array [1, 2] has length 2), just not on ordinal numbers (whether the 1 in that array is the "first" or "zeroth" element). > I notice al…
I don’t know python but I figured out immediately that it should print ['C', 'B']. Does it? If not, Python is just wrong.
I agree that it should be ['C', 'B'] - the way that Python handles negative `step` values is wrong.