r/computerscience • • Apr 02 '25

Counting from 0

When did this become a thing?

Just curious because, surprisingly, it's apparently still up for debate

0 Upvotes

70 comments sorted by

View all comments

Show parent comment

1

u/Dry-Establishment294 Apr 02 '25

Sounds kinda true but I think the compilers got a bit more work to do to accommodate for the size of each array item therefore it's a more abstracted and convoluted process, no?

1

u/XtremeGoose Apr 02 '25 edited Apr 02 '25

Yes fair point there's a left shift in there too - I'll edit accordingly. The point still stands because 0 * SIZE is still 0.

1

u/nanonan Apr 03 '25

That's fairly trivial, not abstract or convoluted. Your array entries will have a fixed constant size that is usually a power of two.