this post was submitted on 21 Nov 2023
296 points (94.6% liked)

Programmer Humor

32042 readers
1375 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 38 comments
sorted by: hot top controversial new old
[โ€“] cypherpunks@lemmy.ml 51 points 10 months ago (2 children)
  • 0 โœŠ
  • 1 ๐Ÿ‘
  • 2 โ˜๏ธ
  • 3 ๐Ÿ‘†
  • 4 ๐Ÿ–•
[โ€“] xmunk@sh.itjust.works 17 points 10 months ago* (last edited 10 months ago) (1 children)
[โ€“] CanadaPlus@futurology.today 5 points 10 months ago (1 children)
[โ€“] CaptainBlagbird@lemmy.world 1 points 10 months ago* (last edited 10 months ago) (1 children)

2 guys, or I'll 0 you both! 1?

[โ€“] Seudo@lemmy.world 3 points 10 months ago

Why did 2 break up with zero?

Some 1 got between them!

[โ€“] CaptainBlagbird@lemmy.world 12 points 10 months ago (1 children)

6 โœŒ๏ธ

17 ๐Ÿค™

18 ๐Ÿค˜

19 ๐ŸคŸ

28 ๐Ÿ‘Œ

31 โœ‹

[โ€“] Seudo@lemmy.world -4 points 10 months ago

1 ๐Ÿ‘†

2 ๐Ÿ‘†

3 ๐Ÿ‘†

4 ๐Ÿ–•

5 ๐Ÿ–•

6 ๐Ÿ–•

[โ€“] maniacal_gaff@lemmy.world 22 points 10 months ago (1 children)
[โ€“] duck1e@lemmy.ml 2 points 10 months ago
[โ€“] Semi-Hemi-Demigod@kbin.social 19 points 10 months ago (1 children)

If you count in binary you can get to 31 on one hand, and 2,047 on two hands

[โ€“] 30p87@feddit.de 1 points 10 months ago (1 children)

One hand would be 2**5 = 32 (0 to 31) and two would be 2**10 = 1024 (0 to 1023).

And if you use 3 states per finger (down, half raised and raised), you can have 3**10 = 59049 (0 to 59048).

[โ€“] Cethin@lemmy.zip 2 points 10 months ago

I don't count to 1024 over often (literally never) so I don't feel the need to go to trinary.

[โ€“] uis@lemmy.world 5 points 10 months ago (2 children)
[โ€“] datelmd5sum@lemmy.world 1 points 10 months ago (1 children)

coworker taught me this and it blew my mind. I had previously jokingly used base 2 with my hands, but something like 01001 10010 would be difficult to handle.

[โ€“] uis@lemmy.world 2 points 10 months ago* (last edited 10 months ago) (1 children)

Base 2 should be easy to add, but it requires effort to convert

[โ€“] MightyGalhupo@lemmy.world 1 points 10 months ago

It gets easier with practice

[โ€“] itslilith@lemmy.blahaj.zone 0 points 10 months ago (1 children)
[โ€“] anton@lemmy.blahaj.zone 1 points 9 months ago

Binary is better than seximal, unless you rig the tests.

[โ€“] sundrei@lemmy.sdf.org 4 points 10 months ago (1 children)

"Please count to 10."

"... um, I've run out of fingers."

[โ€“] Jorgelino@lemmy.ml 2 points 10 months ago

You only need two fingers for that though

[โ€“] Bishma@discuss.tchncs.de 4 points 10 months ago* (last edited 10 months ago) (1 children)

Nah. 1,2,4,8,16... or 1, 10, 100, 1000, 10000, depending on how you look at it.

[โ€“] CanadaPlus@futurology.today 1 points 10 months ago (1 children)

You use more than one finger at once.

[โ€“] itslilith@lemmy.blahaj.zone 1 points 10 months ago (1 children)

I don't know many people who count like ๐Ÿ‘โ˜๏ธ๐Ÿ–•, so you kinda already do. You're just allowing more combinations

[โ€“] CanadaPlus@futurology.today 1 points 9 months ago

Good point.

[โ€“] 4L3moNemo@programming.dev 3 points 10 months ago

If you count finger joints and tips, using your thumb โ€“ you can count in hex (base16) on each hand.

[โ€“] Odinkirk@lemmygrad.ml 3 points 10 months ago

Honestly, I count using the four fingers for 1-4, close the fingers and extend thumb for five, then extend each finger again for 6-9.

The right hand counts tens and works the same way. Can count to 100, and it's pretty intuitive. It's like if positional notation was discovered way earlier.

[โ€“] Zehzin@lemmy.world 2 points 10 months ago

I've watched Inglorious Basterds I'm not falling for that trick

[โ€“] bi_tux@lemmy.world 2 points 10 months ago

0; 1; 2; 4; 8

[โ€“] Asudox@lemmy.world 1 points 10 months ago

0, 1, 2, 3, 5, 8, 13, 21, etc.

[โ€“] LazaroFilm@lemmy.world 1 points 10 months ago* (last edited 10 months ago)

0 1 10 11 100

[โ€“] gregorum@lemm.ee 1 points 10 months ago

THERE ARE FOUR LIGHTS!

[โ€“] sirico@feddit.uk 0 points 10 months ago (2 children)

Haaaaaang on is that why we start on 0...

[โ€“] DmMacniel@feddit.de 4 points 10 months ago (2 children)

No. We count start at zero because the array already starts with an element of a specific size. Starting at 1 would always skip that initial element.

[โ€“] CanadaPlus@futurology.today 3 points 10 months ago* (last edited 10 months ago)

You could have "empty arrays" in a language if you wanted. The real reason is that you start with an offset of zero as you read an array from memory at hardware level, and so this way address is just "start address + element size * element number".

[โ€“] BorgDrone@lemmy.one 2 points 10 months ago* (last edited 10 months ago) (1 children)

No, we start counting at one. We start indexing at zero.

An array with one element has an element count of 1, and that element would be at index 0.

[โ€“] LaggyKar@programming.dev 3 points 10 months ago

This is how we end up with off-by-one errors

[โ€“] LazaroFilm@lemmy.world -1 points 10 months ago

Because if you convert it back to binary, you have 0x0000 and that is one extra bit you can use instead of limiting your available values.

[โ€“] Subverb@lemmy.world -2 points 10 months ago

AKschually, thumbs aren't fingers.