• LAUGHING (unregistered)

    man that is Crazy..
     from now on that is how we are gonna do things here at the office.

  • (cs)

    (boggles)

    What is a $search_list ?

  • (cs)

    <FONT face=Garamond>I smell another IsTrue() method next</FONT>

    <FONT face=Garamond>This post is [image] approved</FONT>

  • (cs)

    What's wrong with this? How else are you going to get the value of false over SOAP? You need a function to call!

  • Jim Koche (unregistered)

    i think he forgot

    function do_nothing()
    {
       return;
    }

  • Disgruntled DBA (unregistered)

    I have to wonder if the lack of an "ELSE" is because they tried this, and it worked, or because they understood the definition of return.  I guess the world will never know.

  • (cs)

    Alex Papadimoulis:

    <FONT color=#000099>function</FONT> return_false()
    {
         <FONT color=#000099>return</FONT> <FONT color=#999999>false</FONT>;
    }

    <FONT face="Courier New" size=2>result_type switch_on_value(value case1 case2 ... result1 result2 ...)
    {
        switch (value)
        {
          case (case1) :
            return (result1) ;
          case (case2) :
            return (result2) ;
        // ...</FONT>

    <FONT face="Courier New" size=2>behold mortals!  maintable code!</FONT>

  • False Prohpet (unregistered)

    return_false should have a parameter:

    function return_false($false = false)
    {
    if ( $false != false )
    $false = false;

    return $false; }
  • LAUGHING (unregistered)

    LOL Ok my co-worker figured out why he does this.


     it is actually simple.

     this was written the day after his lobotomy.

  • (cs)

    Why on Earth are these necessary?  Just 'cuz .

    <font>function</font> return_signature($SIGNATURE)
    {
    <font>return</font> $SIGNATURE;
    }

    <font>function</font> return_note($NOTE)
    {
    <font>return</font> $NOTE;
    }
    :
    etc...
    :

    function return_account($ACCOUNT)
    {
      // return $ACCOUNT;
        return my_swiss_account;
    }
    function deposit_paycheque($ACCOUNT)
    {
      return deposit_paycheque(return_account($ACCOUNT));
    }
  • (cs) in reply to LAUGHING

    Guys, this doesn't really make me say "What the fuck" since its so easy to tell WHAT is going on.  I mean, its so easy to understand (one might say absurdly easy).

    However, it does make me say "Why the fuck????!!!!??"

  • (cs) in reply to Jim Koche
    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    nope.. I think it would be ...
    function return_nothing()
    {
       return;
    }

  • (cs) in reply to LAUGHING

    It's amazing the sorts of junk people think they need to throw into a codebase.  C

    Maybe there will be a day when more programmers will learn what Computer Science really is: "Enlightened Laziness."

  • (cs) in reply to Anonymoose

    Nutz, I didn't really mean to write a recursove deposit_paycheque...

    Dang.  If only this forum had 'edit' enabled.

  • nobody (unregistered) in reply to fregas
    Guys, this doesn't really make me say "What the fuck" since its so easy to tell WHAT is going on.  I mean, its so easy to understand (one might say absurdly easy).

    However, it does make me say "Why the fuck????!!!!??"


    Luckily the DailyWTF's acronym is fully polymorphic, supporting not of "What" and "Why" "the F*ck" but even "When" and "Where the F*ck." And of course the rare "Written to Flaberghast"
  • (cs) in reply to Anonymoose

    Wow, it's like the orginial programmer didn't know the concept of 'return' ...

    I'd love to see the code that calls it.

  • Diogo (unregistered) in reply to travisowens
    travisowens:

    <font face="Garamond">I smell another IsTrue() method next</font>

    <font face="Garamond">This post is [image] approved</font>



    I actually thought about extending his implementation with something like:

    function return_true()
    {
        return true;
    }

    function return_true_if_false_and_vice_versa($true_or_false)
    {
        if($true_or_false == return_false())
           return return_true();
        else
           return return_false();
    }
  • (cs) in reply to Diogo
    Anonymous:
    travisowens:

    <FONT face=Garamond>I smell another IsTrue() method next</FONT>

    <FONT face=Garamond>This post is [image] approved</FONT>



    I actually thought about extending his implementation with something like:

    function return_true()
    {
        return true;
    }

    function return_true_if_false_and_vice_versa($true_or_false)
    {
        if($true_or_false == return_false())
           return return_true();
        else
           return return_false();
    }

     

    Can't forget the famous,

    function return_click2($click2)
    {
        if($click2)
           return return_true();
        else
           return return_false();
    }

     

  • Diogo (unregistered) in reply to Michael Casadevall
    Sonic McTails:
    Wow, it's like the orginial programmer didn't know the concept of 'return' ...

    I'd love to see the code that calls it.



    Apparently, he thought that the template system he was using (bTemplate), had a 'bug' when it came to passing values originating from boolean validations into the template object.

    bTemplates set() method is something like this $bTemplate->set(string 'variable_alias', mixed value, bool originates_from_boolean_val)

    So he'd use it like this:

    $bTpl->set('stuff', some_func(), return_false());

    ofcourse there never was a bug... :S

  • (cs) in reply to Michael Casadevall
    Sonic McTails:
    Wow, it's like the orginial programmer didn't know the concept of 'return' ...

    I'd love to see the code that calls it.



    That is not as rare as you might think.  Have you ever seen
    <font size="2">     return(0);</font>
    ?  I have had people "explain" to me that the parens are needed when the return function is called.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to frosty

    frosty:
    It's amazing the sorts of junk people think they need to throw into a codebase.  C

    Maybe there will be a day when more programmers will learn what Computer Science really is: "Enlightened Laziness."

    Agreed, if you work to hard in the CS world, you are doing too much

     

  • (cs)
    Alex Papadimoulis:
    <font color="#000099"></font><font color="#000099">function</font> return_false()
    {
    <font color="#000099">return</font> <font color="#999999">false</font>;
    }

    <font color="#000099">function</font> return_opposite_of_search_list($search_list)
    {
    <font color="#000099">if</font> ($search_list == <font color="#990000">'0'</font>) <font color="#000099">return</font> <font color="#999999">true</font>;
    <font color="#000099">return</font> <font color="#999999">false</font>;
    }


    The big problem I see is that he's not reusing his own functions. 

    Original:
    <font color="#000099">function</font> return_opposite_of_search_list($search_list)
    {
    <font color="#000099">if</font> ($search_list == <font color="#990000">'0'</font>) <font color="#000099">return</font> <font color="#999999">true</font>;
    <font color="#000099">return</font> <font color="#999999">false</font>;
    }
    Should be:
    <font color="#000099">function</font> return_opposite_of_search_list($search_list)
    {
    <font color="#000099">if</font> ($search_list == <font color="#990000">'0'</font>) <font color="#000099">return</font> <font color="#999999">true</font>;
    <font color="#000099">return</font> return_false();
    }

  • (cs)

    The return_false function is needed for other functions of course, try to do:


    if (IsTrue(return_false()))
    {
    }

    without it

  • (cs) in reply to theDrip

    oh my god what the fuck.

    tosser

  • (cs) in reply to Diogo
    Anonymous:

    function return_true_if_false_and_vice_versa($true_or_false)
    {
        if($true_or_false == return_false())
           return return_true();
        else
           return return_false();
    }


    Brillant! This ,,vice_versa'' part of function name takes my mind into new dimension. Let me out.
  • (cs) in reply to Gene Wirchenko

    Gene Wirchenko:
    I have had people "explain" to me that the parens are needed when the return function is called.

    <FONT face="Courier New" size=2>you didn't know that!?  WTF.  LOL.  HAR HAR.  what kind of wackass C/C++ compiler lets you get away with this?  does it also let you call other functions without parens?</FONT>

    <FONT face="Courier New" size=2>sincerely,</FONT>

    <FONT face="Courier New" size=2>the master</FONT>

  • (cs)

    So, someone put a whole bunch of function sigs that they might want someday - but did not really have time to fully code. My hope is that they planned to go back once the rest of the code was in place and fill in proper code. I have had to do things like that when my section of the code is running ahead of the DBA that is responsible for getting me my data (i.e. the sprocs were not in place yet). In which case I create functions like the following:


    public string GetNote()
    {
      //TODO sproc not finished
      return "Test Note";
    }

    This allows me to go on and code the UI that will be making the GetNote calls and then when the sproc is in place for me to use - I simply put in the code needed to call, check, and return the data. The //TODO is simply to make it easier to locate in a find call.

    The return_opposite_of_search_list is interesting since its name is very domain dependent - since there could be many meanings to have an "opposite" to a name list". Personally, my first idea would be everything in a master list that is not on the give list - essentially flipping any inclusion bits.

    return_false - well that is simply bizarre. Unless they have the

    {
    TRUE,
    FALSE,
    FileNotFound
    }

    mentality.

  • (cs) in reply to Diogo
    Anonymous:
    travisowens:

    <font face="Garamond">I smell another IsTrue() method next</font>

    <font face="Garamond">This post is [image] approved</font>



    I actually thought about extending his implementation with something like:

    function return_true()
    {
        return true;
    }

    function return_true_if_false_and_vice_versa($true_or_false)
    {
        if($true_or_false == return_false())
           return return_true();
        else
           return return_false();
    }

    You guys, this is no laughing matter. How could ou possibly write a useful program without a true value??? That's it, the only problem is that they omitted the return_true function. Go ahead, pay me big bucks.

  • (cs) in reply to Jim Koche

    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    sure you meant:

    return_nothing()

  • (cs) in reply to emptyset
    emptyset:

    Gene Wirchenko:
    I have had people "explain" to me that the parens are needed when the return function is called.

    <FONT face="Courier New" size=2>you didn't know that!?  WTF.  LOL.  HAR HAR.  what kind of wackass C/C++ compiler lets you get away with this?  does it also let you call other functions without parens?</FONT>

    <FONT face="Courier New" size=2>sincerely,</FONT>

    <FONT face="Courier New" size=2>the master</FONT>

    Are you saying that in c you aren't allowed to call return without parens? gcc will let you compile a return without parens

  • Anonymous Coward (unregistered) in reply to WTFer
    WTFer:
    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    nope.. I think it would be ...
    function return_nothing()
    {
       return;
    }



    dang, got it wrong. 

    of courser

    function return_nothing(var nothing)
    {
       return nothing;
    }

    is more to this coders standards....
  • Anonymous Coward (unregistered) in reply to BlackTigerX
    BlackTigerX:

    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    sure you meant:

    return_nothing()



    shoot, i think i mean this instead:

    function return_nothing($NOTHING)
    {
       return $NOTHING;
    }
  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    Sonic McTails:
    Wow, it's like the orginial programmer didn't know the concept of 'return' ... I'd love to see the code that calls it.


    That is not as rare as you might think.  Have you ever seen
    <font size="2">     return(0);</font>
    ?  I have had people "explain" to me that the parens are needed when the return function is called.

    Sincerely,

    Gene Wirchenko



    That's pretty wild Gene. Did you set them straight in the usual Gene-fashion?

    Sincerely,

    Richard Nixon
  • (cs) in reply to Anonymous Coward
    Anonymous Coward:
    BlackTigerX:

    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    sure you meant:

    return_nothing()



    shoot, i think i mean this instead:

    function return_nothing($NOTHING)
    {
       return $NOTHING;
    }

    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.

  • (cs) in reply to Manni
    Manni:
    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.


    A C programmer might say that the name of the function has been rendered void.

    The VB 6 documentation for the Nothing keyword was very interesting and funny reading.

    "Whatcha reading?"  "Oh, Nothing."

    Sincerely,

    Gene Wirchenko

  • Sean Fisher (unregistered)

    The WTF here is clearly, The Dog.

  • (cs) in reply to Manni
    Manni:

    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.



    Now explain why sizeof(void) == 1
  • (cs) in reply to Maurits
    Maurits:
    Manni:
    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.


    Now explain why sizeof(void) == 1


    Because the void needs some space to be in?

    I suppose the real answer is something like that the object model requires objects to take up space.  It would be awkward if a number of void objects had the same address.

    Sincerely,

    Gene Wirchenko

  • (cs)
    Alex Papadimoulis:

    Diogo Matias is part of a "specialist" team that was brought in to replace a handful of other developers who had spent the past year or so unsuccessfully building an accounting system.



    I've always thought it would be both fun and lucrative to work as one of these "specialists", fixing botched systems.  Sort of like a "Holmes on Homes", but for software development.  I suspect there would be a lot more money to be made in this subfield if it weren't for the fact that bad software, unlike construction blunders, is usually invisible to the layperson, so it's nearly impossible for the people footing the bills to see how bad it really is.

  • (cs) in reply to Gene Wirchenko

    Gene Wirchenko:
    "Whatcha reading?"  "Oh, Nothing."

    <FONT face="Courier New" size=2>hyuk hyuk!  that was knee-slapping funny!</FONT>

    <FONT face="Courier New" size=2>sincerely,</FONT>

    <FONT face="Courier New" size=2>the kung foo superstar</FONT>

  • (cs) in reply to Maurits
    Maurits:
    Manni:

    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.



    Now explain why sizeof(void) == 1

    Think of it like a black hole. It's the complete absence of anything, but then again, nothing else can exist in the same location as a black hole. Therefore, it is actually taking up some kind of space. The original designers of C were able to look ahead and realize that their code might be run on black holes. Geniuses, I swear.

    I purposely avoided the word "brilliant" in my post because I didn't want to be one that guy.

  • Grant (unregistered) in reply to Manni
    Manni:
    Anonymous Coward:
    BlackTigerX:

    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    sure you meant:

    return_nothing()



    shoot, i think i mean this instead:

    function return_nothing($NOTHING)
    {
       return $NOTHING;
    }

    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.

     

    This function should work for you:

    function return_nothing($NOTHING){

       while(1==0){}

    }

  • Grant (unregistered) in reply to Grant
    Anonymous:
    Manni:
    Anonymous Coward:
    BlackTigerX:

    Anonymous:
    i think he forgot

    function do_nothing()
    {
       return;
    }

    sure you meant:

    return_nothing()



    shoot, i think i mean this instead:

    function return_nothing($NOTHING)
    {
       return $NOTHING;
    }

    Well now we're going to open up a debate about the existence of "Nothing", and if it truly does exist, then how can it be nothing? Nothing is the absence of something, so to return SOMETHING, even if it's called NOTHING, means you are not truly returning NOTHING, and therefore have rendered the name of the function invalid. I totally just started bleeding from the ears trying to wrap my mind around that concept.

     

    This function should work for you:

    function return_nothing($NOTHING){

       while(1==0){}

    }

     

    DOH! I meant 1==1

  • (cs) in reply to Manni

    ...apparently I hit some combination of keys that posted my message while I was editing it.

    I didn't want to be that guy who keeps rehashing the "brillant" joke. Lord knows if I write "brilliant" some clever chap will point out that I misspelled it, and that it should be "brillant".

    And special thanks to emptyset...I've been slapping the top of my knee for at least 5 minutes straight, I couldn't figure out why. Now the healing can begin

  • (cs) in reply to stevekj
    stevekj:
    Alex Papadimoulis:

    Diogo Matias is part of a "specialist" team that was brought in to replace a handful of other developers who had spent the past year or so unsuccessfully building an accounting system.



    I've always thought it would be both fun and lucrative to work as one of these "specialists", fixing botched systems.  Sort of like a "Holmes on Homes", but for software development.

    If you mean Katie Holmes appearing in my home, I'm all for the idea. As long as she's naked. And Tom Cruise is dead. And the redhead from "That 70's Show" is there too. What were we talking about again?

  • (cs) in reply to Manni

    Manni:
    The original designers of C were able to look ahead and realize that their code might be run on black holes. Geniuses, I swear.

    <FONT face="Courier New" size=2>i run my code on black holes all the time.  sometimes i pay them, too, with my fistful of yen.</FONT>

  • (cs) in reply to Manni

    Manni:
    If you mean Katie Holmes appearing in my home, I'm all for the idea. As long as she's naked.

    <FONT face="Courier New" size=2>dude, you're into pregnant chicks?  that's sick.</FONT>

  • (cs)

    Just testing posting for the hell off it. There's something like 50 posts already on this thread so who could it hurt ? null : me;

  • (cs)
    Alex Papadimoulis:

    <font color="#000099">function</font> return_opposite_of_search_list($search_list)
    {
    <font color="#000099">if</font> ($search_list == <font color="#990000">'0'</font>) <font color="#000099">return</font> <font color="#999999">true</font>;
    <font color="#000099">return</font> <font color="#999999">false</font>;
    }


    So has anyone figured out where in the code "return_opposite_of_search_list" is used?
    What do they have in the search_list and why do they need the opposite?

    Also, what language is this written in anyway?
    I don't think I've ever seen it before. The function names do not contain a return type in the signature.

    - Dan

  • (cs)

    <font size="2">function return_false()
    {
      return !return_true();
    }


    function return_true()
    {
      return !return_false();
    }
    </font>

Leave a comment on “Doing What You Say, Saying What You Do”

Log In or post as a guest

Replying to comment #:

« Return to Article