- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
So Mary is a boy's name where ?
Admin
TRWTF here is the gender param me thinks
Admin
Chosen by fair sample from population. Guaranteed to be random.
Admin
http://xkcd.com/221/
Admin
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.
Admin
And then along comes......
Admin
What do the "few places" do with it when they've called it? I suspect a few more WTFs lurking there.
Admin
Yet another falls victim to the "random" == "arbitrary" error.
Admin
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."
Admin
But we all know the getReallyRandom name will return . . . 'Dave'
Admin
Well, if there can be a boy named "Sue"...
Admin
...then we can meet our ellipsis quota for the day... or can we...?
Admin
I think it was to keep 'Paula' or 'Kevin' from popping up.
Admin
No the real WTF here is using PHP for OO. ;)
Admin
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".
Admin
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.
Admin
You need to look for seedRandomNameGenerator(string name). It will change the name and recompile the code.
Admin
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...
Admin
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.
Admin
(Well, pedantically speaking, no, we don't. Gender is a concept in grammar, so "Gender Studies" is a narrow subfield of linguistics.)
Admin
In theory, anywhere you want. Erich Remarque's middle name was Maria.
Admin
ftfy? or was that intentional?
Admin
You can never really know... [image]
Admin
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?)
Admin
On the other hand, I did fail at quoting.
Admin
And one step closer, Charles Widor's was Marie...
Admin
Admin
Actually, the "really random" method is called "real_getRandomName".
Admin
I guess there must be something about Mary.
Admin
we never were.
Admin
In embedded systems where you normally don't even have a file system, is very common to use Mary as a random name.
Admin
Yet another thread on yet another forum with the same story, linking same xkcd and Dilbert...
Admin
Not quite like kevin captcha secundum... On a second thought maybe mary is better
Admin
It should return "Slartybartfast". Now that's a random name.
Admin
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.
Admin
you can just rename it to getTheRandomName then it will be true. =)
Admin
It's not an uncommon boy's name in Eire (Republic of Ireland)
Admin
Obligatory inane pop-culture reference:
There's something about Mary...
Admin
GET_RANDOM_NAME2
Admin
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?
Admin
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. :)
Admin
Middle-Earth.
Admin
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]; }
Admin
Admin
It's a helper method for the random number generator.
int randomNumber = getRandomName().ToCharArray().Count
Admin
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...
Admin
Allow me to refactor that for you:
Admin
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.
Admin
XKCD references are banned on the daily wtf - we have logged your IP address and will be running random DDoS
Admin
Honestly, do you people just sit around all day waiting for opportunities to post the same two xkcd references?