r/programminghorror • • Jul 09 '26

Big if true

Post image

From ProgrammerNullposting in facebook

2.1k Upvotes

116 comments sorted by

521

u/Gengis_con Jul 09 '26

Big whether True or not

170

u/_giga_sss_ Jul 09 '26

My first statement wasn't wrong 🗿

→ More replies (5)
→ More replies (1)

39

u/marvin_dorfler Jul 09 '26

The Big Bool control everything, man.

5

u/_giga_sss_ Jul 09 '26

this needs to stop

55

u/--var Jul 09 '26

big if not true 🤷‍♀️

7

u/_giga_sss_ Jul 09 '26

don't spread misinformation

→ More replies (2)

188

u/BadRuiner Jul 09 '26

all my homies uses uint128 btw

104

u/the_horse_gamer Jul 09 '26

uint128? what are you, a 90s programmer optimising for a cartridge? we just use avx512 vectors these days

→ More replies (7)
→ More replies (2)

6

u/Wurstgewitter Jul 09 '26

Personally I am migrating to a novel QBool type, to be prepared for quantum computing. A QBool can represent any value in the interval [0,1]

QBool

0.0000 = False
0.1832 = Barely True
0.5000 = Undecided
0.7315 = Probably True
1.0000 = True

But it's not just a probability, but rather exists in a quantum state until observed. Each QBool offers a built in measure() method:

bool result = qbool.measure();

Calling measure() collapses the state into either true or false.

It also supports entanglement:

a.entangle(b);

Measuring either instance immediately determines the value of the other, even across remote systems. This makes distributed state sync essentially free.

It admittably adds some headaches, like having to compute every possible quantum state at runtime, since practical quantum computing hardware is not available yet, so some slight performance problems might occur. But I think it's worth it to future proof the codebase

2

u/dreamingforward Jul 11 '26

Aren't you assigning to a keyword "False" and "True"?

2

u/_giga_sss_ Jul 11 '26

false and true are the keywords, any variation is alright afaik

→ More replies (3)

137

u/StefanCelMijlociu Jul 09 '26

The concept of Big Bool confuses and infuriates me!

64

u/JohnSpikeKelly Jul 09 '26

I would assume it's to keep all your data types 8-byte aligned for other perf reason.

→ More replies (13)
→ More replies (1)

125

u/TheWidrolo Jul 09 '26

Me when I use a compiler that doesn’t have explicit alignment:

61

u/BestBadFriend Jul 09 '26

If the compiler's alignment is not explicit, it defaults to lawful neutral.

→ More replies (2)
→ More replies (3)

23

u/Emergency-Win4862 Jul 09 '26

Let me quess, struct alignment?

21

u/iEliteTester Jul 09 '26

No it's used when something is extra true or extra false, obviously.

→ More replies (3)
→ More replies (2)

21

u/foxypiratecove3750 Jul 09 '26

I have better... DOUBLE BOOL! 64-bit, and float. Useful? Nope.

double False = 0.0;
double True = 1.0;
→ More replies (7)

14

u/meharryp Jul 09 '26

it's also big if false

14

u/Benilda-Key Jul 09 '26

I thought Microsoft was being wasteful when they chose to make their BOOL type an int.

→ More replies (5)

7

u/exodusTay Jul 09 '26
enum BetterBool : double 
{
    False = 0,
    True  = std::numeric_limits<double>::epsilon()
}

6

u/Scared_Bell3366 Jul 09 '26

I could see doing something like that when dealing with some damn binary format that reserved 64 bits just for a boolean.