Stop using Booleans

Stop using Booleans

Attached: varg.png (548x437, 281K)

Other urls found in this thread:

asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6263249199595
tutorialspoint.com/cprogramming/c_bit_fields.htm
bbc.com/culture/story/20190213-lords-of-chaos-the-grisly-film-that-has-caused-outrage
reddit.com/r/OutOfTheLoop/comments/5m79pi/comment/dc2nww3
twitter.com/SFWRedditVideos

false

what if i want to store a single bit value and nothing more?

& (1

#define prop 1

Bit fields.

You're still talking up a byte of memory lmao

Use bit field bool when you're in a struct or class. And regular bool when you only need one option. Anything else, twiddle bits.

Realistically no programming job requires this level of autism in 2019

stdbool.h is a gift to mankind. No.

>lol why bother with optimization bro, memory is cheap
This mindset is why Electron exists

your CPU is byte addressable, not bit addressable. You cannot store/access values smaller than 1 byte. I dont even know if bit addressable CPUs exist

Attached: (you).jpg (500x500, 38K)

so what do I use instead

IIRC connection machines had 1-bit processors.

Attached: cm2.png (743x509, 583K)

java.utils.TrueOrFalseManagerImplementation

TrueFalseAbstractFactoryBean trueorfalse = (TrueFalseAbstractFactoryBean) context.getBean("&TrueFalseAbstractFactoryBean")

>not using tristate
TriState.UseDefault my nibba

no u

const _Bool gender;

What about LOGICALs?
They can be true, false, yes, no, or ?

>It's still the 80s
Get with the times, grandpa.

Knock that off

we use them all the time on the software i work on, and i guarantee you've used that software in the past hour at least indirectly

>_Bool
#include

damn kids, isn't it past your bedtime?

Attached: boomer.jpg (704x904, 101K)

>not using a long long and casting char TRUE = '@' and char FALSE = '#' into it.

You know bitmasks exist right? You can effectively access any single bit you want for the most part just not directly.

Fuck you.

asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6263249199595

Never again. "T", "F" and "Y", "N" and 1, 0 and "1", "0" and so on and so forth are all valid methods for representing Boolean values in the multi billion dollar, most popular commercial RDBMS on earth. Retard shit like "don't use Booleans, just use X and Y" is how you end up with pointless fragmentation. Boolean datatypes force people to use the same implementation of the idea of a Boolean. Is it the same shit as 0 and 1? God damn right. But I don't have to worry about arguing over my cube wall with Boomer McCuckFace over 0 and 1 vs "true" and "false" because using anything but a boolean in languages that support them is objectively retarded.

>using Oracle as a source

Attached: trash.gif (580x433, 1.41M)

How's the job hunt going? :^)

But you are still just using one bit , the rest will be unused padding in the memory.

I wish there was a high-tier language that didn't fucking do this.

well, you can allocate a byte and use that byte for 8 booleans, one for each bit, by utilizing bitwise AND

java.util.BitSet

Memory aligned by bit has quite a bit more overhead than by bytes. There is a point of diminishing returns.

C doesn't have this problem

Attached: 1499588055439.gif (460x259, 1.93M)

VHDL

exactly. other languages shouldn't use it either.

It's the compiler's job to be autistic enough to use individual bits to represent booleans. It can group them by 32s in an int easily when it compiles.

I thought there was a way in c to make a struct to do this. Yep, I was right tutorialspoint.com/cprogramming/c_bit_fields.htm

is this a serious suggestion

How do you write if statements?
I always add the parentheses because it looks like the condition is sad to not be true.
condition ? true :( false );

Ok

enum CONDITIONAL { TRUE, FALSE};

>my gender is true

>TRUE == 0
>FALSE == 1
You had one job.

>But you are still just using one bit
Most languages test booleans by comparing the whole to zero, not by testing bits.

>he's never programmed in bash
Kek

I read the entire damned write up on Varg
>bbc.com/culture/story/20190213-lords-of-chaos-the-grisly-film-that-has-caused-outrage

And after twenty minutes of reading I don't know why he's a meme about things I should stop doing. Someone explain.

Attached: 1358641580639.jpg (500x556, 44K)

exit codes != boolean

DEATH TO ELECTRON!

No.

Attached: cf1075974f7c79f229c63f57a30e50c1.jpg (736x488, 102K)

#define MALE 1;
.
.
.
const bool gender;
obj1.gender = MALE;
obj2.gender = !MALE;

>premature optimisation
Spot the people without jobs

reddit.com/r/OutOfTheLoop/comments/5m79pi/comment/dc2nww3

>the devilish wink at the end
heh....nothin personall kid..

This kind of optimisation is strictly forbidden in any multithreaded language. You'd be inventing writes to variables that are never being written to, making correct synchronisation impossible.

I only use booleans.

Stop... or what?

Why ?

no

fpbp

kek

Stop using the number 3.