this post was submitted on 15 May 2025
1158 points (98.6% liked)

Programmer Humor

23427 readers
1332 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] 135 points 1 week ago (4 children)

I set all 8 bits to 1 because I want it to be really true.

[–] [email protected] 94 points 1 week ago* (last edited 1 week ago) (6 children)

01111111 = true

11111111 = negative true = false

[–] [email protected] 48 points 1 week ago (3 children)
[–] [email protected] 1 points 6 days ago

Is this quantum computing? 😜

[–] [email protected] 28 points 1 week ago (3 children)
[–] [email protected] 22 points 1 week ago

100001111 = maybe not

[–] [email protected] 3 points 1 week ago

0011 1111 = could you repeat the question

[–] [email protected] 2 points 1 week ago

00000001 00000000 00001111 10101010

[–] [email protected] 6 points 1 week ago

Schrödingers Boolean

[–] [email protected] 34 points 1 week ago (4 children)

What if it's an unsigned boolean?

[–] [email protected] 25 points 1 week ago

Cthulhu shows up.

[–] [email protected] 3 points 1 week ago

Common misconception... Unsigned booleans (ubool) are always 16-bits.

[–] [email protected] 1 points 1 week ago
[–] [email protected] 12 points 1 week ago

Could also store our bools as floats.

00111111100000000000000000000000 is true and 10111111100000000000000000000000 is negative true.

Has the fun twist that true & false is true and true | false is false .

[–] [email protected] 6 points 1 week ago

Why do alternative facts always gotta show up uninvited to the party? 🥳

[–] [email protected] 4 points 1 week ago (1 children)

So all this time true was actually false and false was actually true ?

[–] [email protected] 3 points 1 week ago (1 children)

Depends on if you are on a big endian or little endian architecture.

[–] [email protected] 6 points 1 week ago

Come on man, I’m not gonna talk about my endian publicly

[–] [email protected] 2 points 1 week ago

negative true = negative non-zero = non-zero = true.

[–] [email protected] 15 points 1 week ago (1 children)

TIL, 255 is the new 1.

Aka -1 >> 1 : TRUE

[–] [email protected] 8 points 1 week ago

But only if you really mean it. If not, it's a syntax error and the compiler will know.

[–] [email protected] 12 points 1 week ago

I was programming in assembly for ARM (some cortex chip) and I kid you not the C program we were integrating with required 255, with just 1 it read it as false

[–] [email protected] 10 points 1 week ago

You jest, but on some older computers, all ones was the official truth value. Other values may also have been true in certain contexts, but that was the guaranteed one.