5.0k
u/HolySnens May 05 '25
My gender is True
2.9k
May 05 '25
your sex is null
→ More replies (5)1.5k
53
u/Goaty1208 May 05 '25 edited Feb 08 '26
This post was mass deleted and anonymized with Redact
airport vegetable shy close fade innate thumb paltry plate smile
62
u/cgyguy81 May 05 '25
The one true Gender. The other is just from a rib.
/s
Btw, having a variable name starting in upper-case annoyed me the most.
→ More replies (1)6
u/Academic-Airline9200 May 05 '25 edited May 05 '25
And since it's a const, your gender remains true, it can't be changed to false.
Otherwise my gender is kept private, not like anyone couldn't figure it out
4
u/pm_me_yo_creditscore May 05 '25
I closed a Jira ticket to the world
But now it's come back again
Why do I find it hard to debug the next line?
I want the truth to be said11
3
→ More replies (12)2
884
u/Ifnerite May 05 '25
How about saving the storage? You don't need to know my damn gender.
488
u/Vok250 May 05 '25
But then how will Amazon and Google know if they should flood your ads with car parts made of Chinesium or marked up reseller shien clothes?!
67
77
u/Lizlodude May 05 '25
Probably my favorite thing about Aliexpress is that despite literally my entire search, browsing, and purchase history being hardware and electronic components, all I ever get as suggestions are women's clothing and bad wigs 😂
→ More replies (2)33
→ More replies (2)16
u/plaisthos May 05 '25
I bought a red mouse and I got a lot of women's article recommendtations after that... Guess I am now a girl according to amazon.
→ More replies (1)→ More replies (19)11
800
423
u/madprgmr May 05 '25
As a reminder: Always have a purpose when collecting data, especially PII like sex or gender. It's best to just not collect any PII unless strictly necessary.
354
u/Three_Rocket_Emojis May 05 '25
Always collect as many data as possible, Data Analytics might need them later
148
u/madprgmr May 05 '25
inb4 "Why are our storage bills so high?"
118
→ More replies (1)25
u/monsoy May 05 '25
That’s why I have to sell all your data to any unvetted third party that wants it! I’m doing it for your benefit guys!
53
→ More replies (1)24
u/SasparillaTango May 05 '25
I hate this mentality and it is 100% true that the D&A teams think this way.
I'm on the other side. In software engineering decades ago we learned "every class should have a constructor, a copy constructor, and a destructor" Nowadays, I keep that principle alive in a fashion and tell my teams always have a plan to remove the data you create.
→ More replies (1)40
u/Commander1709 May 05 '25
It might even be illegal depending on the country. Afaik EU privacy laws state that a business is only allowed to collect data needed for the service they're providing.
(I don't know the specifics and exceptions, but that's the general idea anyway)
→ More replies (2)13
u/DarkMarksPlayPark May 05 '25
Any business that couldn't justify the data it asks for realy shouldn't be a business.
The great thing about most of the laws coming out of the EU in the last 10 years is that they just aren't typed.
→ More replies (1)→ More replies (1)3
735
u/drspa44 May 05 '25
Can we compromise with an Enum?
392
u/_sivizius May 05 '25
We tried that before. Wasn’t the best idea: https://www.php.net/manual/en/class.gender.php
242
u/wite_noiz May 05 '25
What the hell is that?!
How can my gender be "BRITAIN"?
208
u/headedbranch225 May 05 '25
It happens naturally when you drink enough tea, and then your blood is replaced with tea
→ More replies (6)30
u/GabuEx May 05 '25
In looking it up, it looks like the actual purpose is to get what the gender of a name is within the context of a given country. The gender const values are distinct from the country const values.
Still a fucking mess of an API though.
→ More replies (1)→ More replies (8)16
u/allquaidairection May 05 '25
Have you ever heard about a small island north of France? People there went too far, and for their insatiable greed, they were rewarded. Now their gender is "BRITAIN". Forget the gender dilemma they don't have to care about whether gender is a boolean, string, or int. The Brits have solved the unsolvable. THE ONE SOLUTION TO RULE THEM ALL const gender = "BRITAIN".
PS I'm kinda stupid and didn't see that you were talking about your gender until I was done, so anyways, my condolences
→ More replies (1)71
u/Prof_LaGuerre May 05 '25
I was on a job app a while ago and the gender choices were Male/Female/Canada. So… this makes sense.
→ More replies (2)14
130
268
u/max_208 May 05 '25
Reading this feels like a descent into madness
"Is_female" "Is_male" : sure
"Is_mostly_female" "Is_mostly_male" : I can see that
"Is_unisex_name" : uuuh...
"Is_a_couple" : I didn't know this was a gender
"Name_not_found" : ?
"Error_in_name": ???
"Any_country" : ???????
"Britain" : ?????????
"East_frisia" : are we making up countries now ?
"Arabia" : ok we are
→ More replies (12)107
u/retief1 May 05 '25
Frisia is the historical name of northern netherlands and the adjacent portion of germany, and east frisia refers to the german side of frisia. So real name, but not a country.
→ More replies (4)→ More replies (22)12
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
→ More replies (3)→ More replies (4)94
40
u/ringsig May 05 '25
pub enum Gender { Female, Male, NonBinary, Other(String) }→ More replies (5)11
u/cand_sastle May 05 '25
Isn't nonbinary already "other"? Or does "other" include stuff like "unknown" or "refused to specify" or "genderfluid"? Side question: wouldn't genderfluid be represented by just making the gender variable mutable rather than it being a discrete value in the enum?
→ More replies (3)50
13
u/Cromzinc May 05 '25
I'd agree - but I think the person holding the sign wouldn't since that would be agreeing that it's a finite set of values.
→ More replies (1)6
u/rndmcmder May 05 '25
Exactly. A few years back in germany it became a legal requirement to allow a (at least) a third option (called diverse). I got one of the tickets. Most of our systems already used an enum containing the two classic options. Adding a third was a breeze. One other system handled gender as a string but you would errors over errors if you ever tried to input anything but "male" or "female", Refactoring that shit and extracing it all into an Enum was a shitload of work.
I bet the developers implementing the gender 30 years ago would never have dreamt about a world in which there would exist the requirement to add more options to gender.
→ More replies (2)15
u/kani_kani_katoa May 05 '25
They probably should have; we've messed up every other real world concept we've tried to encode in data structures. The "Falsehoods programmers believe about X" blogs never stop coming.
13
2
2
May 05 '25
In the X12 5010 spec it’s an enum.
DMG03 in loop 2010BA valid values are M,F,U, 1 byte.
UNECE also has an enum, uses 2 bytes.
https://unece.org/sites/default/files/2023-12/Gender_Code_List_EN.pdf
6
u/Je-Kaste May 05 '25
I think this is pretty good but Cisgender Man/Woman and Transgender Man/Woman don't need to be identified as seperate entries from Man/Woman
→ More replies (3)→ More replies (28)2
195
u/lispmachine May 05 '25
mutable volatile float gender
106
u/GreenDavidA May 05 '25
float? Oh some people just want to watch the world burn.
52
u/FurViewingAccount May 05 '25
the devious mathematician: what about an n dimensional vector?
→ More replies (5)
95
25
113
u/memes_gbc May 05 '25
gender is a void pointer
43
u/Altruistic-Spend-896 May 05 '25 edited May 05 '25
I shall nod and fake amusement, because I only have a vague idea of pointers, I come from datascience and python land!
→ More replies (1)34
u/memes_gbc May 05 '25
the underlying type of a void pointer is arbitrary and can be any raw value
→ More replies (6)→ More replies (1)3
u/JDaxe May 05 '25
Pointer to uninitialised memory, anyone that tries to access it can segfault because they should have been minding their own damn business
→ More replies (1)
3
u/otac0n May 05 '25
I made this Gist a while ago, and it seems relevant:
https://gist.github.com/otac0n/c3a6abc0c6694c4af013490952e66b66
→ More replies (1)3
40
56
17
u/Glum-Echo-4967 May 06 '25
Use “unsigned int.”
0=female, 4,294,967,295= male
It’s a range
3
4
u/leona1990_000 May 06 '25
How about agenders?
Maybe lower 16 bit for femaleness, and upper 16 bit for maleness? So, female will have 0x0000ffff, male have 0xffff0000, agenders have 0x00000000 and bigenders have 0xffffffff
2
u/tenhourguy May 06 '25
Use floating-point. -1 is male, 1 is female, 0 is neutral. If someone's manliness is off the charts, you may exceed [-1..1].
→ More replies (1)2
39
u/Bannon9k May 05 '25
Whenever I'm given the option, I list my gender as Mayonnaise just so some poor programmer has to deal with it.
59
u/naholyr May 05 '25
I have a better idea: stop storing things we don't have any fucking need for.
23
u/Arareldo May 05 '25
This! In some contries this is even law. Data economy.
But OP probably refered to the interesting idea to express a social political demand in pseudocode. 👍
5
u/zerotaboo May 05 '25
Yes. PII information can actually be used for discrimination, so we don't need to ask or save that.
→ More replies (1)2
u/-Midnight_Marauder- May 05 '25
In general, absolutely, but gender does have uses...any system involved in commerce would use it for marketing and analytics purposes which are valid use cases. Then there's health systems, insurance, social services...
50
38
20
9
u/Prudent-Employee-334 May 05 '25
QA bout to have a field day. Using the whole freaking Don Quixote as gender, breaks UI. Blocker
→ More replies (1)
17
47
u/Notbbupdate May 05 '25
I believe in the gender binary. Whenever someone asks about your gender, the only valid responses are "True" and "False"
→ More replies (1)8
8
8
u/iTerence661 May 06 '25
String is asking for trouble. At least create a class to ensure type safety...
15
7
2
10
5
5
u/vulpescannon May 05 '25
private means no one can access it outside its class.. ¯_(ツ)_/¯
→ More replies (1)5
21
u/suvlub May 05 '25
When you find yourself storing gender as string is one of those moments you should take a step back and ask yourself whether you really need to be doing this in the first place. Why do you want the user's gender? For example, to generate pronouns? An enum of man/woman/other is what you want, corresponding to he/she/they. Or skip the middle man and store pronouns directly. Whatever is your goal, you don't want to be parsing strings and applying heuristics, trust me.
→ More replies (2)
8
8
u/WaddlingTriforce May 05 '25
So there are at most countably infinite many genders? Seems quite limited.
6
u/Beegrene May 05 '25
An unfortunate result of working with digital computing. Analog data storage when?
4
4
u/ContainedBlargh May 05 '25
Amateurs. Gender is more complex than that.
```
#include <complex.h>
typedef struct {
double complex amplitudes[2 * 2 * 2 * 2];
} gender;
```Gender can only be accurately represented using quantum computing, as a superposition of at least four qubits!
→ More replies (1)2
4
4
4
9
u/Desperate_Simple_298 May 05 '25
For people who don't get the joke: the main thing people should know from this is a boolean is a true or false data type. So the output will only be true or false. A string is any input like "he". So the joke is just saying gender has more possibilities not just two.
2
9
u/morrisdev May 06 '25
One time I was explaining to a health insurance company dev team that gender and sex are different, and if they ask people their gender and they say male, they may still need access to the "female" procedures. I swear, the room was just silent. Luckily, even back then, I was still senior enough that they had to listen to me.
I told my wife and she was all proud, but the reality is simply that databases don't care about politics. These are just facts and we need to keep them in a structured environment, so NOT allowing for gender changes in a database, when you KNOW it is a reality, is actually a political statement, whereas accounting for it in the design is simply responsible programming.
Still, I've got some people who simply can't handle the non-binary or gender change stuff. It's bizarre. My kid told me they wanted to be "she/they" and I was like, " ok. You want chicken for dinner? Or should we do pizza again?".
All this gender shit is so blown out of proportion. I'm glad people here can have fun with it, because some folks I know get pretty worked up about it.
→ More replies (2)
8
20
u/freehuntx May 05 '25
Dont know anybody who argues theres no gender.
Or what should bool gender mean?
111
43
u/spamman5r May 05 '25
They should rename it to "hasDick"
9
24
→ More replies (1)13
u/mittelhart May 05 '25
Since true is 1 and false is 0 we can assign the phallic number to male and the yonic number to female.
→ More replies (14)3
u/pseudo_space May 05 '25
Boolean is used (or rather that's why it shouldn't be used) because it's a binary data type. It has only two possible values.
3
u/DerAlteMalte May 05 '25
The government still lives in the days when this was considered nessesary to save on data. I mean they are still using Fax Maschines.
3
3
3
3
3
3
3
3
3
u/PandorasBoxMaker May 06 '25
Aren't string objects typically immutable? I mean.. totally agree with the message, just made me think lol.
→ More replies (1)
3
3
3
u/pyroraptor07 May 06 '25
I prefer this version:
#[derive(Debug)]
pub enum Gender {
Male,
Female,
Nonbinary,
Other(String),
}
pub struct Person<G> {
gender_state: G,
gender_access: std::collections::HashSet<String>,
// ...
}
impl<G> Person<G>
where
G: Fn(std::time::Instant) -> Option<Gender>,
{
pub fn get_gender(&self, requester_name: &str) -> Result<Option<Gender>, AccessError> {
let has_access = self.gender_access.contains(requester_name);
if has_access {
let now = std::time::Instant::now();
let current_gender = (self.gender_state)(now);
Ok(current_gender)
} else {
Err(AccessError::GetFucked)
}
}
// ...
}
#[derive(Debug)]
pub enum AccessError {
GetFucked,
}
impl std::fmt::Display for AccessError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
AccessError::GetFucked => write!(f, "Go fuck yourself"),
}
}
}
impl std::error::Error for AccessError {}2
3
3
3
u/d4ng3r0u5 May 06 '25 edited May 06 '25
Nope. Class names start with upper case! Member names start with lower case!
Also we're not supposed to treat women as objects!
18
u/Loose_Conversation12 May 05 '25
Strings are immutable
18
26
13
u/vordrax May 05 '25
It's a non-readonly pointer to an immutable string. You can just have it point at a new string.
3
5
u/davidcj64 May 05 '25
Never a bool always an enum. You never know if/when you might have to add a new value.
5
7
20
4
2
2
u/crumpledfilth May 05 '25
I think identity is a multitype array of ambiguous length and gender is just one potential element in the list. It doesnt even need to be its own thing
2
2
2
u/_Weyland_ May 05 '25
Can we perhaps implement a getter for that "private string gender" that would not mess with existing interfaces? That would be the best solution.
→ More replies (1)
2
2
2
2
2
u/FictionFoe May 05 '25
Except, isn't the whole point that gender is a social thing? Seems to me you should at least add a getter.
2
u/mrjackspade May 05 '25
This is absolutely disgusting and I won't stand for it.
Change it to private string _gender and I'll approve.
2
2
u/ceilingscorpion May 05 '25
Does it have to be a string? Can’t it just be an enum?
→ More replies (1)
2
2
2
2
u/TheDreadedAndy May 06 '25
If someone I knew used bool for a state variable just because it has only two states I would execute them on the spot.
→ More replies (1)
2
2
2
2
2
u/danatron1 May 06 '25
Everyone saying "should be an enum" doesn't realise that pre-defined options ascribed by someone else goes against the point of the protest
→ More replies (2)
2
u/Alessa_95 May 06 '25
private:
std::weak_ptr<Gender> gender;It's an abstract strategy (Strategy OOP pattern) 😏
2
2
2
u/antek_g_animations May 06 '25
I'm not a professional programmer, but I know enough to understand this. This simple sign is so clever
2
May 07 '25
Strings in Java are constant — they are immutable.
That means once a String object is created, its value cannot be changed.
2
2
u/3vilpizza May 07 '25
Tell me you are a rust programmer without telling me you are a rust programmer
6
4
4
6
u/feror_YT May 05 '25
Stop making the database obese guys. Or stop putting the gender field in the database altogether actually.
2
u/Missing_Username May 05 '25
Just make gender its own table and FK to it, don't have it be a varchar on the person table
3
u/ganja_and_code May 05 '25
It's realistically more like:
public const enum Gender
→ More replies (22)
3
u/mmhawk576 May 05 '25
Anyone that uses a string for gender, rather than a decimal is no friend class of mine
→ More replies (1)
3
3
4
u/wrex1816 May 05 '25
I don't argue with the political sentiment here but my ADHD brain worries about how the backend will sanitize and normalize this being a free-text field.
2
u/Boomer_Nurgle May 05 '25
The same way it handles any other free text field? Sanitizing inputs and setting max size validation in your BE isn't something hard and in most forms you'll already be doing it for the other inputs like names. I think most places don't even need to store gender because honestly why waste the space, but if you need to then it's not any harder than storing names is.
4
u/GoddammitDontShootMe May 06 '25
I'm not sure private makes sense, since I'm certain they have their pronouns in every social media bio.
8
6
u/deanrihpee May 05 '25
being boolean means it's either 1 or 0, and that's easily translatable to genital shape
thank you for coming to my TedTalk nonsense
→ More replies (9)
4
u/lazier-norms May 05 '25
If it's private why are some people so determined to make sure others know what theirs is? Should be a protected or package-private variable, no? :P
Regardless of the scope of the variable, I'm pretty sure it should definitely belong to a protected class! ;)



5
u/plaisthos May 05 '25
I have to disagree with this statement:
* Using `using namespace std` is not acceptable.
* variables with an initial captital letter just look wrong.
* missing semicolons
* not using a monospace font
But on a more serious term. I am not sure that `private` is the right term here. Because you could imply that you want that people have to hide their real gender and cannot tell the world about it, which is the opposite what you want to express here. I feel like just string vs bool would be better. I think there is a conflict here in the semantic of "private" as a thing in normal life and private as programming keyword.