• (cs) in reply to Aaron
    Aaron:
    Honestly, do you people just sit around all day waiting for opportunities to post the same two xkcd references?

    Two? What's the other one?

  • (cs) in reply to Lorne Kates

    Damn, I was sure I was going to be first with the Hendrix ref...

  • hey persto (unregistered) in reply to EvanED
    EvanED:
    NSCoder:
    It should return "Slartybartfast". Now that's a random name.
    How big of a geek am I for immediately recognizing that the correct spelling of that is Slartibartfast?
    Not very. And even less since you think you are.
  • Azeroth (unregistered) in reply to Mason Wheeler
    Mason Wheeler:
    Aaron:
    Honestly, do you people just sit around all day waiting for opportunities to post the same two xkcd references?

    Two? What's the other one?

    Oh, yes, I've been waiting for this question!!! I'll post the link to Bobby comic as soon as I find the link. Please nobody comment meanwhile!

  • Nobody (unregistered) in reply to Azeroth
    Azeroth:
    Please nobody comment meanwhile!
    Commenting as requested.
  • sqlblindman (unregistered)

    Perhaps it is actually referring to "Mary Random", a secretary in the HR department, and this is just a very severe case of hard-coding.

  • Herohtar (unregistered) in reply to Maurits
    Maurits:
    > Mary is a boy's name where?

    Middle-Earth.

    No. You're thinking of Merry, short for Meriadoc.

  • (cs) in reply to Mason Wheeler
    Mason Wheeler:
    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.
    And, in Spanish, Italian and probably a bunch of related languages (and some not so related, like German) Maria is commonly used as a second name, as in José María (Spanish), Carlo Maria (Italian), and Klaus Maria (German). Might depend on the country, though.
  • Brian Manahan (unregistered)

    MY NAME IS SUE.

    HOW DO YOU DO?

    NOW YOU GONNA DIE.

  • Ian (unregistered) in reply to Mel
    Mel:
    Well, if there can be a boy named "Sue"...

    Not to mention "the man they call Jayne".

  • (cs) in reply to EvanED
    EvanED:
    NSCoder:
    It should return "Slartybartfast". Now that's a random name.
    How big of a geek am I for immediately recognizing that the correct spelling of that is Slartibartfast?

    It's not important.

  • grzlbrmft (unregistered) in reply to Montoya
    Montoya:
    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]; }

    This made me lough. I especially like how the $gender is unused.

    captcha: abbas (how many of them?)

  • Synchronos (unregistered) in reply to Helix
    Helix:
    we have logged your IP address and will be running random DDoS

    Like everybody sending e-mails containing only "Mary"?

  • Mark (unregistered)

    So it's a stub function that was never fully implemented. Er. So? This actually looks like a good programming practice whose only fault was that this particular function wasn't important enough for someone to get around to implementing properly.

    The fact that it was found by accident instead of during an investigation for why "Mary" keeps showing up in various places also shows it's not a very important method.

    I wish the WTFs I find were this simple.

  • Anon (unregistered)

    The obvious solution is to place a phone book on a wooden table, set up a web cam to capture an image, use OCR convert the image to words and then pick a name from there. Just remember (VERY IMPORTANT!), every day you need to flip the page in the phone book or you'll end up with the same set of names as the day before.

  • Bub (unregistered)

    The precise "Mary" being returned is perfectly random, thank you.

  • Anon (unregistered) in reply to Anon
    Anon:
    The obvious solution is to place a phone book on a wooden table, set up a web cam to capture an image, use OCR convert the image to words and then pick a name from there. Just remember (VERY IMPORTANT!), every day you need to flip the page in the phone book or you'll end up with the same set of names as the day before.

    Also, we could handle the gender parameter by keeping every name and the associated gender (male, female, either or FILE_NOT_FOUND) in an XML file so that after reading a name from the phone book, you can look up what gender it is. If it isn't the gender requested, grab another name from the phone book.

  • Sprezzatura (unregistered)

    I'm guessing it's just a placeholder. The original author meant to elaborate, but the requirement for a random name came & went and there the function lies, waiting to be enhanced by the next voyager.

    That would be you.

  • Bub (unregistered) in reply to Anon
    Anon:
    The obvious solution is to place a phone book on a wooden table, set up a web cam to capture an image, use OCR convert the image to words and then pick a name from there. Just remember (VERY IMPORTANT!), every day you need to flip the page in the phone book or you'll end up with the same set of names as the day before.

    That'll never work. Once you've OCR'd the page, you need to tabulate the results, print them out individually and stash them inside Kinder Eggs, fill a room full of the things, then toss a black, mute, blind, deaf, legless, hunchback, lesbian midget in to select one at random.

    Just remember (VERY IMPORTANT), tie a rope around her waist and hold onto it tightly, or you'll never be able to retrieve her.

  • (cs)

    This is a new but increasingly common and popular paradigm. You first define a function with a generic name (getRandomName), and a generic/pseudo implementation to meet the basic requirements. When there's time and budget later on, you expand it with a more extensive implementation (getRealRandomName).

  • ted (unregistered) in reply to grzlbrmft
    grzlbrmft:
    I especially like how the $gender is unused.

    I know exactly how that feels...

  • Anon (unregistered) in reply to Bub
    Bub:
    toss a black, mute, blind, deaf, legless, hunchback, lesbian midget in to select one at random.

    Good luck getting HR to put that in the job description. Unless they can wrap the whole thing up in a single catch-all phrase...perhaps "somebody like Kevin"?

  • sino (unregistered) in reply to Steve the Cynic
    Steve the Cynic:
    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...

    Eh, or a gay side-kick... er...not that there's anything wrong with that!!1!

  • Contra (unregistered) in reply to powerlord
    powerlord:
    No the real WTF here is using PHP for OO. ;)

    I came here for a comment like this. Leaving satisfied.

  • (cs) in reply to Herohtar
    Herohtar:
    Maurits:
    > Mary is a boy's name where?

    Middle-Earth.

    No. You're thinking of Merry, short for Meriadoc.

    And look, you've drawn a geek out of its shelter. Now what?

  • coad fale (unregistered) in reply to Helix
    Helix:
    jspenguin:
    http://xkcd.com/221/
    int getRandomNumber()
    {
        return 4;    // chosen by fair dice roll.
                     // guaranteed to be random.
    }
    

    XKCD references are banned on the daily wtf - we have logged your IP address and will be running random DDoS

    void randomDDos() { run "DDoS 127.0.0.1"; }

  • Oh THAT Brian! (unregistered) in reply to Yalpe Nismou

    Where is Mary a boy's name? Perhaps you don't remember the 'Married With Children' episode where Kelley burned the beloved family couch. There was one copy of the couch left, owned by the designer. He changed his name to something that sounded more like Muh-Ray. How was it spelled? Mary. Isn't that a girl's name, they asked? No, a girl spells it mAry (vocal accent on the 'a'). He spelled it marY.

    Yeesh. I have to stop falling asleep in front of the TV.

  • Anon (unregistered) in reply to TGV
    TGV:
    Herohtar:
    Maurits:
    > Mary is a boy's name where?

    Middle-Earth.

    No. You're thinking of Merry, short for Meriadoc.

    And look, you've drawn a geek out of its shelter. Now what?

    Hit geek with sword

  • Yale (unregistered)

    TRWTF is that the function returns an incorrect value half the time. Here's the fix:

    public static function getRandomName($gender)
       {
          return 'Pat';
       }
    
  • no_YOU_are (unregistered)

    If you must know, we call that function to assign $whoWantsToDoYou and that it's the first thing the user sees after logging in. Helps morale around here. Anyway, we used to have a sizable list of switch-hitting sluts in the office (primarily in marketing and accounts payable) but sadly, after downsizing, Mary is all we have left.

  • Anon (unregistered) in reply to no_YOU_are
    no_YOU_are:
    If you must know, we call that function to assign $whoWantsToDoYou and that it's the first thing the user sees after logging in. Helps morale around here. Anyway, we used to have a sizable list of switch-hitting sluts in the office (primarily in marketing and accounts payable) but sadly, after downsizing, Mary is all we have left.

    The recession has been particularly hard on the office sluts.

  • Spike (unregistered) in reply to Yalpe Nismou
    Yalpe Nismou:
    So Mary is a boy's name where ?

    In middle earth, Mary, of Mary and Pipin fame.

    Also I once knew a guy named Marion, who went by Mary.

  • jbarreneche (unregistered) in reply to Sika

    Luckily, no one has posted this [image]

  • Kevin (unregistered) in reply to jbarreneche
    jbarreneche:
    Luckily, no one has posted this [image]

    Nope, it was posted already...

    captcha: gravis

  • Paula (unregistered)

    To Hell with Mary...

    public static function getRandomName($gender) { return 'Irish Girl'; }

  • ParkinT (unregistered)

    return getRandomName("hermaphrodite") + " is Brillant";

  • (cs) in reply to EvanED
    EvanED:
    NSCoder:
    It should return "Slartybartfast". Now that's a random name.
    How big of a geek am I for immediately recognizing that the correct spelling of that is Slartibartfast?
    I actually used that as a test-name in a previous version of our library. It generated code if classes weren't found, and the existence of a method 'slartibartfast' signalled it was a generated dummy-class. I even included a nice comment that people should feel free to change it if they ever needed a method named 'slartibartfast'.

    Of course, that was before I decided that generated code was nonsense and it should just throw a FILE_NOT_FOUND exception ;)

  • (cs) in reply to EvanED
    EvanED:
    NSCoder:
    It should return "Slartybartfast". Now that's a random name.
    How big of a geek am I for immediately recognizing that the correct spelling of that is Slartibartfast?
    +42i geek points. I actually thought it might be an i, and considered checking it, but didn't. Although it's been about 13 years since I read it, I only recently read Neil Gaiman's book about h2g2, and I am the kind of person who generally remembers how words are spelled after seeing them once, so I'm not sure how I got it wrong. I must have done it deliberately, since the y adds extra randomness. Yeah, that's it.
  • Anon-e-mouse (unregistered) in reply to Mel

    A Johnny Cash reference. Very nice.

  • Right Wing-Nut (unregistered) in reply to coad fale
    coad fale:
    Helix:
    jspenguin:
    http://xkcd.com/221/
    int getRandomNumber()
    {
        return 4;    // chosen by fair dice roll.
                     // guaranteed to be random.
    }
    

    XKCD references are banned on the daily wtf - we have logged your IP address and will be running random DDoS

    void randomDDos() { run "DDoS 127.0.0.1"; }

    ... And we close out with a User Friendly reference. (Actually a double reference--quite elegant.)

  • (cs) in reply to Kevin
    Kevin:
    Nope, it was posted already...

    captcha: gravis

    Exactly the sort of low-grade WHOOOSH cognition we've come to expect from the sort of people who post their captchas.

  • (cs) in reply to Spike
    Spike:
    Yalpe Nismou:
    So Mary is a boy's name where ?

    In middle earth, Mary, of Mary and Pipin fame.

    That's Merry, not Mary; as has been said before.

  • ikegami (unregistered)

    "Random" is frequently used to mean "arbitrary"

  • Mr.'; Drop Database -- (unregistered) in reply to mernen
    mernen:
    Actually, the "really random" method is called "real_getRandomName".
    It's funny and all that MySQL has a function called that, but you should link to the actual function reference instead of the PHP frontend to it.
  • gizmore (unregistered)

    Obviously some names had to get removed because else this line of code would be broken:

    echo getRandomName().' has a little Lamb.';
    
  • (cs)

    Unfortunately, getReallyRandomnName() is already defined, too:

       public static function getReallyRandomName($gender)
       {
           return 'Spencer';
       }
    
    

    He's going to have to go with getTrulyRandomName().

  • James (unregistered)

    That's coding to requirements:

    "Req 1.3.5: We want a function that returns some random name each time it's called"

    "Mary" is some random name, let's return that!!

  • (cs) in reply to Anon
    Anon:
    > Hit geek with sword

    You fight like a dairy farmer.

  • (cs)

    To all the Merry vs. Mary pedants... you do know his name was actually Kalimac, right?

  • Man in Black (unregistered) in reply to Brian Manahan
    Brian Manahan:
    MY NAME IS SUE.

    HOW DO YOU DO?

    NOW YOU GONNA DIE.

    Yeah, That's what I told him. Well I hit him hard right between the eyes, and he went down, but to my surprise, Come up with a knife and cut off a piece of my ear......

Leave a comment on “Quite Contrary”

Log In or post as a guest

Replying to comment #:

« Return to Article