News for hackers. Stuff that matters.
Re:Again on 0-based vs. 1-based indexing by coldtea on Wednesday January 20, 2021 @08:23AM (#25846094)
>a sure sign that it is non-intuitive

Well, 0-based is not what we use in everyday life, and even arriving at the invention of 0 took us several millenia, so I'd say its non-intuitiveness is pretty much established...

Re:Again on 0-based vs. 1-based indexing by gjm11 on Wednesday January 20, 2021 @11:06AM (#25848053)
Intuition depends on what you're used to.

The ancient Greeks didn't think 1 was a number; as late as ~1500CE Isidore of Seville was saying "one is the seed of number but not number". After all, if there's only one thing you don't need to think of it as a set of things, so there's no counting to do.

(I think in some quarters it was even argued that two isn't a number, but I forget the details. Compare the fact that some languages treat pairs of things differently in their syntax from larger groups.)

But it turns out that mathematically it's a really good idea to count 1 as a number and allow sets of size 1, and these days everyone does it and no one is very confused by it. (Well, maybe by the "sets of size 1" thing. Exhibit A: Perl. Exhibit B: Matlab.) And because we're now all used to thinking of 1 as a number, it's hard even to understand how anyone might have found it unintuitive.

If we all started counting from zero and taught our children to do likewise, intuitions 50 years from now might be somewhat different from what they are now.

Re:Again on 0-based vs. 1-based indexing by gfxgirl on Wednesday January 20, 2021 @01:00PM (#25849591)
We use it all the time. It's a measure of distance. If you haven't moved from where you started you've moved zero distance.

That's what it represents in indexing, the distance you have to travel to get to the element you want.

Re:Again on 0-based vs. 1-based indexing by coldtea on Wednesday January 20, 2021 @01:53PM (#25850348)
>We use it all the time. It's a measure of distance. If you haven't moved from where you started you've moved zero distance.

That's an offset. It's already covered in detail in TFA.

We don't deal with such offsets in programming, except in C pointer arithmetic (which infested this upon us).

Re:Again on 0-based vs. 1-based indexing by teekert on Wednesday January 20, 2021 @08:24AM (#25846114)
Well, I was born aged 0, turn 1 at the start of my second year on the planet.
Re:Again on 0-based vs. 1-based indexing by coldtea on Wednesday January 20, 2021 @09:04AM (#25846549)
You didn't have 1 year, but you had 1 day old or 2 weeks old, or 3-6 months old, etc.

People never said and still dont' say "this baby is 0 years old". They start at the first complete item of the lower level time units and progress from there...

Re:Again on 0-based vs. 1-based indexing by mc32 on Wednesday January 20, 2021 @08:35AM (#25846226)
For ages people use the unit that best captures the spirit of what they want to communicate.

So they may say one hour old, five days old, six months old, etc. a fifty year old typically doesn’t say they are a half centenarian either. Now decades are used to express an age range like so and so is a nonagenarian to avoid being specific.

Re:Again on 0-based vs. 1-based indexing by improbable22 on Wednesday January 20, 2021 @08:28AM (#25846155)
If you ask kids how old they are, you will often get "5 and a half" etc. They are, correctly, thinking of time as a continuous variable. You "turn 1" when your age reaches 1.0.
Re:Again on 0-based vs. 1-based indexing by IncRnd on Wednesday January 20, 2021 @04:19PM (#25852137)
0-based is absolutely what we use in everyday life.

How many more things can I fit in that box? How many comments are in that HN page?

I'd write more, but I'm running on empty and my pen is out of ink.

Re:Again on 0-based vs. 1-based indexing by jhayward on Wednesday January 20, 2021 @01:52PM (#25850331)
Really? What value does the 'minutes' digit of the first minute of an hour have?