this post was submitted on 18 Jul 2025
344 points (97.0% liked)

Programmer Humor

25425 readers
1013 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
[–] r00ty@kbin.life 5 points 2 weeks ago (2 children)

Oh right. I thought it might work the same as range etc in python, where is does one less than you specify.. Coming from, well every other language this really threw me off on my first python excursion.

[–] ChaoticNeutralCzech@feddit.org 1 points 2 weeks ago (1 children)

Any language... except MATLAB. Fuck MATLAB.

(Their arrays even start at 1, what the fuck?!)

[–] wheezy@lemmy.ml 1 points 2 weeks ago* (last edited 2 weeks ago)

Lua starts at 1 too. It's infuriating. I believe for the same historical reason Matlab does.

Both meant for non CS people.

[–] shape_warrior_t@programming.dev 1 points 2 weeks ago

You can get the exclusive behaviour with random.randrange. (Relevant Stack Overflow question with a somewhat interesting answer)