News for hackers. Stuff that matters.
Re:Why do arrays start at 0? by yongjik on Wednesday August 24, 2022 @01:59PM (#32583260)
That's why I prefer the Superior(TM) Korean age counting. You are one year old when you're born (it's your first year!). You are two year old on the next New Year's day. (Congratulations, it's your second your now!)

So, if you're born on December 31st, you're two years old the next day. (I see no problem, but apparently some people are hung up on such minor details. I can't fathom why.)

Re:Why do arrays start at 0? by tromp on Wednesday August 24, 2022 @02:36PM (#32583828)
> You are one year old when you're born (it's your first year!)

That makes no sense to me. It's also your first century. Does that make you one century old? Of course not! The moment you're born, you're not even one hour old, let alone one day.

Re:Why do arrays start at 0? by BuckRogers on Wednesday August 24, 2022 @03:11PM (#32584306)
They must like rounding up. I guess it depends how they refer to it in their language. If it's "he's in his 1st year", that's a big difference from, "he's 1 year old". I'm wondering if the parent comment simply doesn't know Korean or only knows it somewhat to misconstrue the culture behind this.

It could be though that Korea simply never encountered the Mayan or Arabic civilizations as most did encounter one of those two in history, who are famously known to have independently discovered the concept of zero.

Birth of an array can only logically be defined as index zero, the same as a child. The concept of zero was not universal globally and Korea is pretty isolated.

Re:Why do arrays start at 0? by OscarCunningham on Wednesday August 24, 2022 @05:38PM (#32586112)
Except that we actually do use this system for years. Thus 1 BC (the first year BC) was followed by 1 AD (the first year AD). Also for centuries, as in 'the 20th century' being the years 1901 to 2000.
Re:Why do arrays start at 0? by hathawsh on Wednesday August 24, 2022 @04:56PM (#32585627)
A more sensible English translation from Korean would be to use the phrase "in year X" rather than the phrase "X years old": a newborn is in year 1; after 12 months they are in year 2; etc.

In fact, this whole discussion is more about a choice of phrasing rather than the numbers. When indexing arrays, sometimes we're talking about an offset from the first element (starting with "0"), and sometimes we're talking about ordinal element numbers (starting with "first"). Some programming language designers found that offsets are more useful (because that choice tends to simplify the underlying arithmetic), while others found that ordinal numbers are more useful (because the word "first" should mean "1", to simplify communication between people).

Re:Why do arrays start at 0? by OscarCunningham on Wednesday August 24, 2022 @05:39PM (#32586119)
Right. I try to refer to a[n] as 'element number n' rather than 'the nth element'.
Re:Why do arrays start at 0? by BeFlatXIII on Wednesday August 24, 2022 @04:00PM (#32584963)
> I see no problem, but apparently some people are hung up on such minor details. I can't fathom why.

Americans and their alcohol laws…

Re:Why do arrays start at 0? by gumby on Wednesday August 24, 2022 @02:21PM (#32583632)
This system is used for racehorses as well.
Re:Why do arrays start at 0? by dllthomas on Wednesday August 24, 2022 @03:13PM (#32584335)
There's nothing wrong with the definition per se, but there's the question of what purpose you're putting it to. We should expect more similarity from two "newly 2" children with the "western" system than the Korean one.
Re:Why do arrays start at 0? by galangalalgol on Wednesday August 24, 2022 @02:16PM (#32583556)
Doesn't Korea use the same new year as China? Usually second new moon after winter solstice.
Re:Why do arrays start at 0? by smegsicle on Wednesday August 24, 2022 @03:30PM (#32584582)
hung up on minor details!