| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
|
So Mary is a boy's name where ?
|
|
TRWTF here is the gender param me thinks
|
|
Chosen by fair sample from population. Guaranteed to be random.
|
|
http://xkcd.com/221/
|
|
Looks OK to me. One of my coworkers once wrote a random function which always returned 6. He argued that 6 was as likely as any other number.
|
|
And then along comes......
|
|
What do the "few places" do with it when they've called it? I suspect a few more WTFs lurking there.
|
|
Yet another falls victim to the "random" == "arbitrary" error.
|
nowhere ... otherwise you wouldn't be insulting the guy's manhood when you used it as an insult. e.g., "Stop whining about the code, .. Mary." |
|
But we all know the getReallyRandom name will return . . . 'Dave'
|
|
Well, if there can be a boy named "Sue"...
|
Re: Quite Contrary
2010-02-10 09:35
•
by
Anonymous Coward
(unregistered)
|
...then we can meet our ellipsis quota for the day... or can we...? |
|
I think it was to keep 'Paula' or 'Kevin' from popping up.
|
|
No the real WTF here is using PHP for OO. ;)
|
Could be short for "Marion". Not common but there are some men with that name. Not up to par with "Kelly", "Chris", "Terry", "Courtney", "Pat", "Lynn" or "Beverly". |
|
TRWTF is that just under half of the places where it is called use "true" as the param, just under half use "false" as the param, and the remainder use FILE_NOT_FOUND. There, that should dust it off nicely.
|
|
You need to look for seedRandomNameGenerator(string name). It will change the name and recompile the code.
|
|
C'mon guys, is nobody (aside from me, that is) going to mention Marion Morrison in the quest for confused names?
And never mind the problems my father had owing to the USian tendency to assume that Robin is a girl's name... |
|
I'm guessing the coder initially put in a bogus return value just so it would return a string as expected, but forgot to go back later and actually make it do what was it was supposed to.
|
Re: Quite Contrary
2010-02-10 09:51
•
by
Steve the Cynic
(unregistered)
|
gender == true presumably would apply to the entire population, even those who are confused about what the gender actually is. We all *have* a gender, right? (Well, pedantically speaking, no, we don't. Gender is a concept in grammar, so "Gender Studies" is a narrow subfield of linguistics.) |
Re: Quite Contrary
2010-02-10 09:52
•
by
Someone too lazy to login and at work
(unregistered)
|
In theory, anywhere you want. Erich Remarque's middle name was Maria. |
Re: Quite Contrary
2010-02-10 09:52
•
by
Justsomedude
(unregistered)
|
ftfy? or was that intentional? |
|
You can never really know...
|
|
Actually, it makes a lot of sense. Someone wrote a mock for this function to test other functionalities and they accidentally forgot to implement the proper code. The only WTF I see here is not adding a "// TODO: implement this" and something like "#ifndef debug error 'the implementation is not finished'"
Captcha: nulla (are we still posting the captchas?) |
What? It's a perfectly valid use, according to http://en.wikipedia.org/wiki/Ellipsis. "An ellipsis can also be used to indicate a pause in speech, an unfinished thought, or, at the end of a sentence, a trailing off into silence (aposiopesis) (apostrophe and elipsis mixed)." On the other hand, I did fail at quoting. |
Re: Quite Contrary
2010-02-10 10:10
•
by
JakeyC
(unregistered)
|
And one step closer, Charles Widor's was Marie... |
As the saying goes: Words have gender, people have sex. |
|
Actually, the "really random" method is called "real_getRandomName".
|
|
I guess there must be something about Mary.
|
|
we never were.
|
|
In embedded systems where you normally don't even have a file system, is very common to use Mary as a random name.
|
|
Yet another thread on yet another forum with the same story, linking same xkcd and Dilbert...
|
|
Not quite like kevin
captcha secundum... On a second thought maybe mary is better |
|
It should return "Slartybartfast". Now that's a random name.
|
|
It all depends on initial condidions.
What is the universe of names that the function is supposed to choose from? Biblical names? Female names? English names? Employee database? Then - why would anyone need a random name? My first guess, to use in an example (credit card mockup) or in English tests ("Mary ________ to school"). On second guess, it could be used in advertisement. Say, a user is logged in - the ad shows him a credit card with his name on it. But what to do when the user is not logged in? Let's show him some random name - in this case Mary. It would be more fun though to have Heywood Jablome. |
|
you can just rename it to getTheRandomName then it will be true. =)
|
It's not an uncommon boy's name in Eire (Republic of Ireland) |
|
Obligatory inane pop-culture reference:
There's something about Mary... |
Nah, do it the Oracle way-- GET_RANDOM_NAME2 |
|
TRWTF is that submitter's source control system did not provide him a changelog.
I mean, he must be using a source control system, right? |
Re: Quite Contrary
2010-02-10 11:26
•
by
Swedish tard
(unregistered)
|
Oooh, Im SO going to start putting that into our codebase wherever I find a //TODO: or //FIXME: ... Might even modify our commit scripts to do it. :) |
|
> Mary is a boy's name where?
Middle-Earth. |
|
The coder clearly forgot to randomize the possibilities. Here is the correct way to do this:
public static function getRandomName($gender) { $names = array('Mary'); shuffle($names); return $names[0]; } |
How big of a geek am I for immediately recognizing that the correct spelling of that is Slartibartfast? |
It's a helper method for the random number generator. int randomNumber = getRandomName().ToCharArray().Count |
|
Kevin would never have wrote something like that. He would have created a database of all possible names and returned a truly random result every time.
Sure do miss that guy... |
|
Allow me to refactor that for you:
|
|
In Spanish, Italian, and probably a bunch of related languages, "Mario" is the masculine version of "Maria" (Mary), and is a fairly common male name.
|
XKCD references are banned on the daily wtf - we have logged your IP address and will be running random DDoS |
Honestly, do you people just sit around all day waiting for opportunities to post the same two xkcd references? |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |