r/programminghorror • u/_giga_sss_ • Jul 09 '26
Big if true
From ProgrammerNullposting in facebook
2.1k
Upvotes
r/programminghorror • u/_giga_sss_ • Jul 09 '26
From ProgrammerNullposting in facebook
521
u/Gengis_con Jul 09 '26
Big whether True or not
39
u/marvin_dorfler Jul 09 '26
The Big Bool control everything, man.
55
u/--var Jul 09 '26
big if not true 🤷♀️
13
u/worthlessDreamer Jul 09 '26
Why
188
u/BadRuiner Jul 09 '26
all my homies uses uint128 btw
6
u/Wurstgewitter Jul 09 '26
Personally I am migrating to a novel
QBooltype, to be prepared for quantum computing. AQBoolcan represent any value in the interval [0,1]But it's not just a probability, but rather exists in a quantum state until observed. Each
QBooloffers a built inmeasure()method:bool result = qbool.measure();Calling
measure()collapses the state into eithertrueorfalse.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"?
137
u/StefanCelMijlociu Jul 09 '26
The concept of Big Bool confuses and infuriates me!
125
u/TheWidrolo Jul 09 '26
Me when I use a compiler that doesn’t have explicit alignment:
23
u/Emergency-Win4862 Jul 09 '26
Let me quess, struct alignment?
21
u/foxypiratecove3750 Jul 09 '26
I have better... DOUBLE BOOL! 64-bit, and float. Useful? Nope.
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.
7
u/exodusTay Jul 09 '26
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.
9
u/Rigamortus2005 Jul 09 '26 edited Jul 09 '26
It's just 56 bits after all. Who needs it
4
u/MatJosher Jul 10 '26
Boolmaxxing
4
u/therealdan0 Jul 10 '26
So this of why Anthropic and OpenAI are buying all the memory.
1
u/Beginning-Junket8979 Jul 15 '26
At least they used unsigned so we didn't get negative true
1
u/Substantial-Fee4459 Sep 16 '26
what about SmallBool
3
u/NsupCportR Jul 09 '26
This just triggered me 😆
3
u/metaconcept Jul 12 '26
Story time.
In Smalltalk,
trueandfalseare just objects on the heap. There's a very special primitive method calledbecome:which lets you swap two objects around on the heap.So anyway, it was possible to do
true become: false.in Smalltalk, which swaps true for false and false for true across the entire system. It didn't crash ...immediately..., but I wouldn't deploy this in production!2
u/AivasTlamunus Jul 10 '26
This is what AI is taking from us
2
u/SomeRandoLameo Jul 10 '26
Big fucking weighted statement
2
u/magicmulder Jul 11 '26
What, no signed bool?
2
u/Positive_Mud952 Jul 12 '26 edited Jul 12 '26
Oh, goddamn, some actual humor. I love you.
e: It is big! And wide! May nobody doubt its truthiness. Oh father I am ENLIGHTENED!
2
u/bistr-o-math Jul 16 '26
Let as make a PetaBool
2
u/conundorum Aug 05 '26
To be fair, there is a use for this.
Which just means that the real horror is that someone found a way to break integral promotion sobadlythat they needed to have a pre-promoted bool type just to fix it.1
u/brasticstack Jul 09 '26
Wouldn't regular
boolget padded to this size by default on a 64-bit architecture anyway?2
u/Mahringa Jul 09 '26
So this brings other bool types into existence? SemiBigBool AlmostBigBool HumongousBool AverageSizedBool BigBlackBool
1
u/DankPhotoShopMemes Jul 09 '26
might as well use 4-value logic
1
u/_____rs Jul 09 '26
Truuuuuuuue
1
u/samhk222 Jul 09 '26
Mine is average
1
u/Aromatic_Pain2718 Jul 10 '26
We've had long floats and long longs, it's time for long booleans
1
u/IntelligentBelt1221 Jul 11 '26
where did my law of the excluded middle go though
1
u/Straight-Pear9453 Jul 13 '26 edited Jul 13 '26
ok hear me out, what if we made a small bool that's one bit and the compiler tracks and marks bytes dedicated to small bools and so the advantage is that if you have one small bool it takes a byte like a normal one but when you have two it still takes a byte, up to 8 small bools. Now idk if that's a good idea since pointers would become 9 bytes as we'd have to track which bit we point to as well.. but eh, technically possible.
Edit: I realize pointers can't become 9 bytes because the cpu follows the pointers in asm directly so there are standards to be respected here, so idk how to solve this issue but the 1 bit bool concept is just too great to give up 🥀
Edit 2: Well at least we can do it in asm because we track stuff manually with our brains, if someone can figure out how to make a compiler do it without loosing memory overall tho that'd be great!
Edit 3: After research, I realized this already exists and is called bit fields, so I kinda reinvented the wheel here.