this post was submitted on 11 Feb 2025
992 points (100.0% liked)

Programmer Humor

21900 readers
2563 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 32 points 1 month ago* (last edited 1 month ago) (25 children)

GTFOH with that. 1-indexed arrays?! You monster.

(Mostly joking... Ok, somewhat joking :P )

[–] [email protected] 6 points 1 month ago (5 children)

How is arrays starting at 1 still a controversial take. Arrays should start at 1 and offsets at 0.

[–] [email protected] 6 points 1 month ago (1 children)

So what's 0 do then? I'm okay with wacky indexes (I've used something with negative indexes for a end-index shorthand) but 0 has to mean something that's actually useful. Using the index as the offset into the array seems to be the most useful way to index them.

[–] [email protected] 1 points 1 month ago

I'd say the index is actually an offset is a reasoning for explaining why it should start at 1. If index was an index, I'd just start at 1.

I don't think any one is better than the other, but history chose 0.

That you can choose it in VB is probably the worst option :D

load more comments (3 replies)
load more comments (22 replies)