Live data from Hacker News

Numbering should start at zero (1982)

cs.utexas.edu

141–150 of 309 posts

Re: Numbering should start at zero (1982)

#142

Numbering should start at π (2025) (umars.edu) Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them (0-based). The former uses natural numbers, while the latter uses non-negative integers For instance, when dealing with memory words, do u address the word itself or its starting location (the first byte)? The same consideration applies to coordinate systems: r u pos…

      Numbering should start at π (2025) (umars.edu)
It's funny because pi is the joke compromise between 0 and tau, the circumference of the unit circle, and the period length of the trigonometric functions.

Re: Numbering should start at zero (1982)

#143
post #138

Earlier quoted context omitted.

“serious discussion” notwithstanding, I thought the “u’re” was particularly interesting. Why not “ur”? “u” is obviously easier to write, so why worry about properly contracting it? Just interesting imo

It wasn’t clear to me what “u’re” was and I wouldn’t have understood without the comment. I’m a native English speaker.

Wasn’t the guy who wrote “all correct” as “oll korrekt”[1] a native [American] English speaker also?

—-

1. https://en.m.wikipedia.org/wiki/OK

Re: Numbering should start at zero (1982)

#144
post #142

Numbering should start at π (2025) (umars.edu) Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them (0-based). The former uses natural numbers, while the latter uses non-negative integers For instance, when dealing with memory words, do u address the word itself or its starting location (the first byte)? The same consideration applies to coordinate systems: r u pos…

Numbering should start at π (2025) (umars.edu) It's funny because pi is the joke compromise between 0 and tau, the circumference of the unit circle, and the period length of the trigonometric functions.

I think we can pretend now that anyone talking about pi is just being sarcastic? It is such a random and useless number, a perfect candidate for a funny meme

Re: Numbering should start at zero (1982)

#145
Starting from zero saves memory. If I have a variable used as an index for an array of 256 elements, starting from 0 allows me to store it in a single byte. If I start from 1, I need two bytes, effectively doubling the memory usage—an unnecessary 100% increase. Now, multiply this inefficiency across every instance where programs encounter a similar situation.

Re: Numbering should start at zero (1982)

#146
post #145

Starting from zero saves memory. If I have a variable used as an index for an array of 256 elements, starting from 0 allows me to store it in a single byte. If I start from 1, I need two bytes, effectively doubling the memory usage—an unnecessary 100% increase. Now, multiply this inefficiency across every instance where programs encounter a similar situation.

> Starting from zero saves memory.

Computer memory.

Re: Numbering should start at zero (1982)

#147
post #134

Earlier quoted context omitted.

Not zeroth but ground floor vs 1st floor in buildings is common.

That's a good example! Elevators sometimes have a 0 for the ground floor, but they often have an "E" in German-speaking countries or a "C" in English-speaking countries. In this example, people also call the floor with index 1 the "first floor," although they don't call the ground floor the zeroth floor, as you say. Since floors can go below ground, the first underground floor is floor -1, so everything works out. Th…

"C"? It's more likely to be "G" round here.

By the way, has anyone else had this problem: you're on floor 10, say, and you want to get to floor 15, say, so you run up 5 flights of stairs and try to find the room but then after a while you realise that somehow you've ended up on floor 16 so you think you're going demented and can't count but after this has happened a few times you realise ... THE IDIOTS HAVE OMITTED FLOOR 13!

If there's one thing worse than 1-based indexing it's leaving-out-13-based indexing ... Has any programming language tried doing that with arrays, I wonder?

Re: Numbering should start at zero (1982)

#148
post #144
post #142

Earlier quoted context omitted.

Numbering should start at π (2025) (umars.edu) It's funny because pi is the joke compromise between 0 and tau, the circumference of the unit circle, and the period length of the trigonometric functions.

I think we can pretend now that anyone talking about pi is just being sarcastic? It is such a random and useless number, a perfect candidate for a funny meme

> It is such a random and useless number

Random ? Useless ?

Re: Numbering should start at zero (1982)

#150
post #11

I found it devastating that there are no distinct agreed-upon words denoting zero- and one-based addressing. Initially I thought that the word "index" clearly denotes zero-base, and for one-base there is "order", "position", "rank" or some other word, but after rather painful and humiliating research I stood corrected. ("Index" is really used in both meanings, and without prior knowledge of the context, there is real…

I always thought: - Offset: 0-based - Index: 1-based

Index is ambiguous. I think "Offset" and "Itemized".
Post reply on HN