• (cs)

    No doubt return_true_24() not only returns true, it aborts if it thinks that you're a terrorist seeking to take control of the US government.

  • Marak (unregistered)

    What's wrong with this?

     I write functions all the time that return true.

     

     

    captcha: tps         mmmmmmmmm yeaaaaaaaaaaaah

  • Christophe (unregistered)

    Of course it makes perfect sense. You need a family of functions to reflect varying degrees of 'truthiness'.

  • OMG (unregistered) in reply to Marak

    So, what's new?

    enum Bool {
    TRUE,
    TRUE_1,
    TRUE_2,
    // ... TRUE_23,
    TRUE_24,
    FALSE,
    FILE_NOT_FOUND
    };

  • (cs) in reply to Marak

    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm

  • JL (unregistered)

    Alex Papadimoulis:
    There are actually twenty-three other return_true functions in the system, each one doing something slightly different and, ironically, often returning false.

    I'd be fascinated to see some examples -- ideally, three or more.  Given the function's only purpose is to return a boolean value, I wonder what "slightly different" actions it could be performing...  Some nasty side-effects, perhaps?  Or maybe the code contains "#define bool int"?

  • (cs) in reply to dpm
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

  • LordVetinari (unregistered)

    The WTF for me is the Symantec add in the RSS feed that says 'Enterprise security software that gets to threats before they get to you'.

    Two things:

    • Enterprise... Not a good word to use on this forum.
    • 'before they get to you'... are they talking about Symantec or the threats?

     

    wtFFtw 

    captcha: awesomeness

  • Erzengel (unregistered) in reply to Marak
    Anonymous:

    What's wrong with this?

     I write functions all the time that return true.

    (I hope you're joking) There's a differance between a function with a meaningful name that returns true, and a function whose stated purpose is to return true, and yet might not. One should give such a function a meaningful name so that maintainers will know what's really happening in the function:

    //Note: WTF's are intentionally preserved: Feel free to count them.

    bool return_true88()
    {
        if(return_true12() && return_true5()) return true;
        else if(return_true19())
        {
            FILE* junk = fopen("config.txt", "r");
            char tmp[256];
            fread(tmp, 1, 256, junk);
            it(tmp[0] == 'a') return true;
        }
        return false;
    }

     As you can see, you really don't know what's happening in 12, 5, and 19. All you know is that 88 tends to open a file, forget to close it, and contains no error checking. imagine if these had meaningful names, like CheckRegistry, CheckCommandVars, and ConfigExists.

  • Corporate Cog (unregistered)
    Alex Papadimoulis:

    For clarification, the "_24" suffix is not some bizarre homage to the author's favorite television show. It's ordinal; there are actually twenty-three other return_true functions in the system, each one doing something slightly different and, ironically, often returning false.

    Proof positive that all maintenance programmers (like myself) are suckers. 

    Captcha = awesomeness.  I wish.
     

  • OMG (unregistered) in reply to Autonuke

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

  • Jason (unregistered) in reply to OMG
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

     

    This Anonymous fails in a most spectacular way. Congratulations in showing your literary ignorance :P. 

  • mav (unregistered)

    (rampant speculation)

    maybe the function looked like this:

    bool return_true_24()
    {

       static int truthiness = 24;
       return (truthiness) ? (truthiness-- != 0) : false;
    }


     

     

  • narrator (unregistered) in reply to OMG

    The number 42 refers to The Answer to The Ultimate Question of Life, The Universe, and Everything from The Hitchhiker's Guide to the Galaxy by Douglas Adams. The ultimate question turned out to be 'what is six times nine', also from Adams' series.

    So... intentional, but not a WTF.
     

  • (cs) in reply to OMG
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

    Nope.  Yours is the WTF for now knowing The Hitchhikers Guide Trilogy lore. 

  • Zap (unregistered) in reply to OMG
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

     

    6*7 = 42 if you use a tridecimal system.

  • Jason (unregistered) in reply to Zap

    and oddly enough, 6 * 9 = 42 in base 13.

     

    Captcha: knowhutimean  No, I don't think I do.
     

  • Zap (unregistered) in reply to Zap
    Anonymous:
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

     

    6*7 = 42 if you use a tridecimal system.

     

    actually, that should be "6*9" instead of "6*7". 

  • (cs) in reply to Jason

    "I may be a pretty sad person, but I don't make jokes in base 13."

    --Douglas Adams

     

  • PlasmaB (unregistered) in reply to Erzengel

    The only circumstances under which i would write a function like this is if i were writing a proc/function who's implementation has yet to be completed *and* i wish to test the rest of the system in isolation.

    This sort of thing should, of course, be FIXME'd to death! and never reach test, let alone live!

    The WTF is that there are coders out there that do this!!! Mind you don't trip over your spurs boys!!!

     

     

  • Jason (unregistered) in reply to emurphy
    emurphy:

    "I may be a pretty sad person, but I don't make jokes in base 13."

    --Douglas Adams

     

     

    Which is why I said 'oddly enough'...

  • (cs)

    it doesnt get better than this.... truly a "Representative Line" :D

  • (cs) in reply to Zap

    The real WTF is that this article has turned into nothing but a pedantic HHGTTG festival....

  • PlasmaB (unregistered) in reply to nuclear_eclipse

    >The *real* WTF is that this article has turned into nothing but a pedantic HHGTTG festival....

    agreed! lets have some *real* WTFs please!

  • (cs) in reply to PlasmaB
    Anonymous:

    >The *real* WTF is that this article has turned into nothing but a pedantic HHGTTG festival....

    agreed! lets have some *real* WTFs please!

    I once quoted "Resistance is useless!" and was chided "Resistance is FUTILE!  Get it right!".  Evidently I was in the middle of a pendantic something else festival.

  • Jon W (unregistered)

    Seems to me as if these functions were actually reverse-engineered from somewhere. That's how you get to names like these. That, or a massive amount of scripted program transformation...

  • Proud To Be Junior (unregistered) in reply to newfweiler

    The ultimate WTF method declaration we had at my last place from one of our Senior Software Developers was a method in java declared as:

     public List fetchSameButDifferent(List other);

     

    I can't remember what it did (or tried to do), but I will never forget that name...

     

  • (cs)

    The REAL WTF is that they don't start numbering from zero!

    *ba dum bum pish*

     

  • (cs) in reply to newfweiler
    newfweiler:
    Anonymous:

    >The *real* WTF is that this article has turned into nothing but a pedantic HHGTTG festival....

    agreed! lets have some *real* WTFs please!

    I once quoted "Resistance is useless!" and was chided "Resistance is FUTILE!  Get it right!".  Evidently I was in the middle of a pendantic something else festival.

     Resistance is Volts over Amperes.

  • Matthew (unregistered)

    Heh. That's clever. Thanks for sharing. :)

    Captcha: 1337

     

  • bruzie (unregistered) in reply to marvin_rabbit
    marvin_rabbit:
    Anonymous:

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

    Perhaps you meant return_true_6() * return_true_<font size="+1">7</font>(), or was that an intentional wtf?

    Nope.  Yours is the WTF for now knowing The Hitchhikers Guide Trilogy lore. 

     But how do you know that the question isn't 6 x 7? The computer that was calculating the great question (Earth) was compromised by the addition of the Golgafrinchams 2 million years before readout. Therefore the question was tainted - 6 x 9 = 42. The question was supposed to be calculated by the humans descended from the cavemen, not the telephone sanitisers.

    We don't know (and neither did DNA) what the true question was.
     

  • (cs) in reply to Autonuke

    was beat to it....

  • (cs) in reply to OMG

    The "real WTF" is that it isn't consolidated into one function:

    return_true(int truthiness_level) {
    switch (truthiness_level) {
    case 1:
    // do whatever it is that
    // those crazy cats are doing...perhaps:
    return true && false || true ^ false || true -1 & sqrt(false);
    case 2:
    ...
    case 24:
    return k_shoot_myself_in_the head;
    }
    }

    Hmmm after rereading this I think I should have added explicit sarcasm tags. Or are they implied for all posts on TDWTF?

  • (cs)

    Anonymous:
    Since we are in subject of WTFs and 42: (Source)

    #include <stdio.h>
    #define SIX 1 + 5
    #define NINE 8 + 1
    int main() {
      printf( "The real meaning of life: %d\n", SIX * NINE );
      return( 0 );
    }

     

    Thanks for the link...I never read an analysis of a C program in Italian before.

  • (cs)

    <wtf/>

    what about:

    public int GetInt()

    {

    int  

    }

  • (cs)

    <wtf/>

    what about:

    public int GetInt()

    {

    int  nValue

  • (cs)

    <wtf/>

    what about:

    public int GetInt()

    {

    int  nValue

    =
  • (cs)

    <wtf/>

    what about:

    public int GetInt()

    {

    int  nValue 

  • (cs)

    <wtf/>

    what about:

    public int GetInt()

    {

    int  nValue  =

  • (cs)

    <wtf/>

    what about:

    public int GetInt()

    {

    int  nValue  = 0;

    return nValue;

    }

    and then having all of your developers use GetInt when they need an local variable.

     

  • (cs)

    AAAAAAAAAAAAAAAAAA sorry people

  • sf (unregistered) in reply to Autonuke

    Autonuke:
    dpm:
    I call dibs on writing the  <font face="COURIER">return_true_42()</font> function.

    ok
    dpm


    :-)

    return (bool) ( return_true_6() * return_true_9() );

     I prefer:

    if ( (bool) ( return_true_6() * return_true_9() ) == TRUE)

         return TRUE;

    else

         return FALSE; 

  • (cs) in reply to newfweiler

    I hope you corrected the misguided pedant. The correct line is indeed "Resistance is useless!", as can be heard on track 16 of the CD edition. Oh, and for more information on this vital subject, please refer to this article.






    :-)

  • (cs)

    the TRUE wtf is that it's not a tri-state! Bheh.... I was going to write something about how I want to wrap my hands around the whole dev team's necks including  the project managers, but bleck... I've accepted the fact that craptastic shit like this is an everyday occurance. I only hope that I'm never on such a team...

  • (cs) in reply to narrator
    Anonymous:

    The number 42 refers to The Answer to The Ultimate Question of Life, The Universe, and Everything from The Hitchhiker's Guide to the Galaxy by Douglas Adams. The ultimate question turned out to be 'what is six times nine', also from Adams' series.

    So... intentional, but not a WTF.
     

     Being pedantic about HGttG is entirely fun -- especially since I've been re-reading the series recently -- so I'm gonna go ahead and be pedantic and say:

     "Yeah, um, we never actually find out what the ultimate question is in the book, that part where Arthur pulls letters out of a hat is just a joke. Arthur got it, you should too. Also, the correct quote is 'what do you get when you multiply six by nine'."

     

    Ok, I'm done. :D
     

  • Eam (unregistered) in reply to Whiskey Tango Foxtrot? Over.

    bool return_true_24()

    {

      return Convert.ToBoolean("They have my daughter".ToString());

  • (cs) in reply to Whiskey Tango Foxtrot? Over.
    Whiskey Tango Foxtrot? Over.:

     "Yeah, um, we never actually find out what the ultimate question is in the book, that part where Arthur pulls letters out of a hat is just a joke. Arthur got it, you should too. Also, the correct quote is 'what do you get when you multiply six by nine'."

    Agreed. DNA expanded the joke to actually make more sense in the book version, where Ford notes that it's probably the wrong question, or a variation on the right one (before they pull out the letters). Having it turn out to be a variation on the wrong one was the humorous bit, which most people miss anyway.

    In the radio series it is much less clear, I grant you. The gag there is more along the lines of it indeed being the correct question, it simply turns out that the universe itself was wrong.

  • Truly_Me_24 (unregistered)

    Hmmm... could that code be the result decompiling a non-debug build?

    I ask because I've seen *production* code in use before that was "lost" and recovered by decompiling the binary that resulted from the last successful non-debug compilation. Why it wasn't just recovered from source control is a whole other WTF-worthy story.

    Anyway, the code in question included very nonsensical variable and function names, I remember a few specifically that had been named by the last line in the function
     

  • (cs) in reply to Hans

     

  • Anonymous (unregistered) in reply to newfweiler

    newfweiler:
     

    I whole-heartedly agree with you.  How do I sign up for your newsletter? 

Leave a comment on “Representative Line: Tetricosanary Logic”

Log In or post as a guest

Replying to comment #:

« Return to Article