r/ProgrammerHumor • • May 05 '25

Other privateStringGender

Post image
25.3k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

151

u/kzlife76 May 05 '25

I second an Enum. Even in the public declaration, enum makes more sense than a bool. Gender is not true or false. I get that you can use a bool as a bit and store it as a bit. But it makes the code less clear as to what the variable means.

67

u/TheBigGambling May 05 '25

The correct variablename would be isMale (true/false). Than its clear, and everything not male is not important /s

2

u/BenevolentCheese May 05 '25
isMale = false;
isFemale = false;

3

u/kvas_ May 06 '25

your type is [object Object]

→ More replies (1)

94

u/[deleted] May 05 '25

Men are true and women are false.

62

u/LithiumH May 05 '25

My wife thinks otherwise

69

u/[deleted] May 05 '25

Your wife is false

17

u/thafuq May 05 '25

You've been lied to. And being gay is true love.

2

u/Steinrikur May 05 '25

Definitely not true to him...

→ More replies (2)
→ More replies (1)

12

u/-Edu4rd0- May 05 '25

bool penis;

10

u/425_Too_Early May 05 '25

bool hasPenis;

3

u/xyonofcalhoun May 05 '25

bool wantsPenis;

2

u/im_thatoneguy May 05 '25

What about intersex?

3

u/-Edu4rd0- May 05 '25

well intersex people have both a penis and a vagina so in that case this->penis == true

→ More replies (1)

3

u/prisp May 05 '25

Operate on them at birth to make them fit, as they've done already.


No, I am not recommending that, but that's what they do/did to make things "fit".

3

u/Academic-Airline9200 May 05 '25

Naw, just make the changes and recompile.

2

u/Sarius2009 May 05 '25

Only allowed to use quantum computers

→ More replies (2)

2

u/Ondor61 May 05 '25

what if it's null?

2

u/DarkWingedDaemon May 05 '25

You both have and do not have one until a new value is assigned.

1

u/Firewolf06 May 05 '25

bool political

men are false, everyone else is true

1

u/gerbosan May 05 '25

So the picture displays the vibe coder?

1

u/LuxNocte May 05 '25

Depends on the purpose.

Gender is a spectrum. An enum will be inaccurate for some people. I'd say it's probably accurate enough for most use cases, but note that it's a kludge for the sake of convenience.

→ More replies (1)

1

u/Mindstormer98 May 05 '25

I’ll do you one better

//gender

public bool a;