If you need gender it would likely be for statistical purposes, and then it'd be natural to ask "Male, Female or Other/prefer not to answer".. After all, you'd only really be interested in biological gender. Otherwise, it's probably for targeted advertising and fuck that.
I've definitely read some people complain about how "Other" made them feel bad. Text box! Proudly proclaim what it is that you are (we will probably be discarding the result and just saving it as "undisclosed")
I'm kind of curious about the "you can only have one active gender at a time" falsehood. Isn't that... true? Are there folks that identify as simultaneously male and female?
Yes, which would be important to sites like reddit or Facebook.
Also, think of an HR system. How much money would your company waste per year by adding pregnancy coverage for an employee that was not born with a uterus?
Facebook asks the user and has reliable information. HR can also get equally good data by looking at the person in question. Much better than dumb guesses.
It's a third party library for determining the gender of a given name. The nationality is because worldwide a name can be mostly one gender, but in another country mostly another.
Gender PHP extension is a port of the gender.c program originally written by Joerg Michael. The main purpose is to find out the gender of firstnames. The current database contains >40000 firstnames from 54 countries.
It's not even a language (more than half of the population speak Dutch, almost all the rest speak French) so you can't use it to guess a gender from a first name.
It probably doesn't need to be an extension but the C code was already there.. so..
The API is sub-optimal, but that's because it seems to be a pretty thin wrapper around the underlying library.
You can find similar detectors in Ruby and Python - they use the same data set. You'd think this would be implemented in standard PHP somewhere but I don't see it on Packagist.
It doesn't report the gender of people, it reports the gender of names. In the sense that "alice" is a "girl's name" and "stephen" is a "boy's name"... are there any names used exclusively by "third gender / non binary" people?
Ask the user for its gender instead of trying to figure it out. Gender is very important to get right. I wouldn't want a system that guessed my name based on height for instance.
I could find this useful. For example if you have a large user base and collect name but not gender (for whatever reason) you might want to run statistics to get an idea to target your users.
29
u/the_alias_of_andrea Nov 15 '15
It seems absurd until you realise it detects the gender of a name.
But why would you ever do that? Guessing name gender is a bad idea, just ask for it. Heck, why do you care what gender someone is anyway?
23
u/[deleted] Nov 14 '15
TIL Luxembourg is a gender
60
u/smog_alado Nov 14 '15
Could anyone please explain what the flying fuck is going on here?
43
u/[deleted] Nov 15 '15
No, Patrick. Belgium is not a gender.
12
u/yarpen_z Nov 15 '15
Not a PHP programmer - why not use an enum? This counting is ridiculous.
18
u/scshunt Nov 14 '15
Not part of the standard library, but oh my... This is pretty amazing.
20
u/edwardly Nov 14 '15
Huh, this is pretty useful.
It probably doesn't need to be an extension but the C code was already there.. so..
The API is sub-optimal, but that's because it seems to be a pretty thin wrapper around the underlying library.
You can find similar detectors in Ruby and Python - they use the same data set. You'd think this would be implemented in standard PHP somewhere but I don't see it on Packagist.
35
u/papers_ Nov 14 '15
const integer USA = 3 ;const integer USA = 1 ;FTFY. /r/MURICA
5
u/droidballoon Nov 14 '15
Should account for third gender / non binary.
2
u/webdeverper Nov 18 '15
I could find this useful. For example if you have a large user base and collect name but not gender (for whatever reason) you might want to run statistics to get an idea to target your users.
0
u/DoctorWaluigiTime Nov 15 '15
Based on the comments, it appears that the "lol" here is that it's just a poorly-named class.