this post was submitted on 15 Sep 2023
217 points (92.5% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
top 15 comments
sorted by: hot top controversial new old
[–] Xtallll@lemmy.blahaj.zone 31 points 2 years ago (1 children)

0✊

8☝️

9🤘

12✌️

17🤙

25🤟

31✋

[–] SHITPOSTING_ACCOUNT@feddit.de 11 points 2 years ago (2 children)
[–] 18107@aussie.zone 3 points 2 years ago
[–] writeblankspace@lemm.ee 1 points 2 years ago

🖕we love 4

[–] fubo@lemmy.world 21 points 2 years ago

Doc, if you can't count to 1023 on your fingers, you might be doing CS wrong!

[–] grue@lemmy.world 10 points 2 years ago (5 children)

Oh, for fuck's sake.

Your thumb is not your zeroth finger; it's your first finger.

Starting from zero is for situations when you're counting the left (or first) edge of containers used to hold items. For example, if you wanted to count the number of balls you could hold in the spaces between your fingers, you start with 0 because the number of balls you can hold between your thumb and {} is 0.

[–] Cargon@lemmy.ml 8 points 2 years ago

Indices vs offsets. A lot of people mistake the two because they took CS 101 and thought it was so cool to say I sTaRt cOuNtInG fRoM zErO.

[–] DmMacniel@feddit.de 4 points 2 years ago (1 children)

But length of container gives you for example 3, and it has a size of 4. Explain that.

[–] TonyTonyChopper@mander.xyz 3 points 2 years ago

length measures the spaces between the spaces between your fingers, so you can fit 3 balls between the 4 balls between your fingers

[–] Phoenix3875@lemmy.world 2 points 2 years ago

There you are, our CS doctor.

[–] spauldo@lemmy.ml 2 points 2 years ago

Also indexes. Once you've been bitten enough by off-by-one errors this actually becomes a pretty handy double-check.

[–] hairinmybellybutt@lemmy.world -1 points 2 years ago

You're angry

[–] psud@lemmy.world 7 points 2 years ago

Hmm. I use 1, 2, 4, 8, 16 (I seldom need to count beyond 31 (and have up to five more bits if needed), or to zero)

[–] sounddrill@lemmy.antemeridiem.xyz 2 points 2 years ago (1 children)

I'm just learning about number systems!