Comment On Doing What You Say, Saying What You Do

Diogo 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. Since the project was months behind deadline and had never produced a working deliverable, management dismissed the team and handed the "specialists" the code with the hopes that they could "just make it work." Looking at the code from the old team, I think this should be a fairly easy task; after all, everything is completely self-documenting. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Doing What You Say, Saying What You Do

2005-10-31 14:08 • by LAUGHING
man that is Crazy..

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

Re: Doing What You Say, Saying What You Do

2005-10-31 14:08 • by Maurits
(boggles)

What is a $search_list ?

Re: Doing What You Say, Saying What You Do

2005-10-31 14:08 • by travisowens

I smell another IsTrue() method next


This post is  approved

Re: Doing What You Say, Saying What You Do

2005-10-31 14:08 • by rikkus
What's wrong with this? How else are you going to get the value of false over SOAP? You need a function to call!



Re: Doing What You Say, Saying What You Do

2005-10-31 14:10 • by Jim Koche
i think he forgot

function do_nothing()
{
   return;
}

Re: Doing What You Say, Saying What You Do

2005-10-31 14:11 • by Disgruntled DBA
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.

Re: Doing What You Say, Saying What You Do

2005-10-31 14:13 • by emptyset

Alex Papadimoulis:

function return_false()
{
     return false;
}


result_type switch_on_value(value case1 case2 ... result1 result2 ...)
{
    switch (value)
    {
      case (case1) :
        return (result1) ;
      case (case2) :
        return (result2) ;
    // ...


behold mortals!  maintable code!

Re: Doing What You Say, Saying What You Do

2005-10-31 14:14 • by False Prohpet

return_false should have a parameter:

function return_false($false = false)

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

return $false;
}

Re: Doing What You Say, Saying What You Do

2005-10-31 14:15 • by LAUGHING
LOL Ok my co-worker figured out why he does this.





 it is actually simple.



 this was written the day after his lobotomy.

Re: Doing What You Say, Saying What You Do

2005-10-31 14:17 • by Anonymoose
Why on Earth are these necessary?  Just 'cuz .



function return_signature($SIGNATURE)
{
return $SIGNATURE;
}

function return_note($NOTE)
{
return $NOTE;
}
:
etc...
:

function return_account($ACCOUNT)

{

  // return $ACCOUNT;

    return my_swiss_account;

}

function deposit_paycheque($ACCOUNT)

{

  return deposit_paycheque(return_account($ACCOUNT));

}

Re: Doing What You Say, Saying What You Do

2005-10-31 14:18 • by fregas
48831 in reply to 48829

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????!!!!??"

Re: Doing What You Say, Saying What You Do

2005-10-31 14:19 • by WTFer
48832 in reply to 48825
Anonymous:
i think he forgot

function do_nothing()
{
   return;
}


nope.. I think it would be ...

function return_nothing()

{

   return;

}



Re: Doing What You Say, Saying What You Do

2005-10-31 14:19 • by frosty
48833 in reply to 48829
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."

Re: Doing What You Say, Saying What You Do

2005-10-31 14:20 • by Anonymoose
48834 in reply to 48830
Nutz, I didn't really mean to write a recursove deposit_paycheque...



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

Re: Doing What You Say, Saying What You Do

2005-10-31 14:25 • by nobody
48835 in reply to 48831
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"

Re: Doing What You Say, Saying What You Do

2005-10-31 14:27 • by Michael Casadevall
48836 in reply to 48834
Wow, it's like the orginial programmer didn't know the concept of 'return' ...

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

Re: Doing What You Say, Saying What You Do

2005-10-31 14:30 • by Diogo
48838 in reply to 48823
travisowens:

I smell another IsTrue() method next


This post is  approved





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();

}

Re: Doing What You Say, Saying What You Do

2005-10-31 14:32 • by mrsticks1982
48840 in reply to 48838
Anonymous:
travisowens:

I smell another IsTrue() method next


This post is  approved




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();
}

 

Re: Doing What You Say, Saying What You Do

2005-10-31 14:35 • by Diogo
48843 in reply to 48836
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

Re: Doing What You Say, Saying What You Do

2005-10-31 14:36 • by Gene Wirchenko
48844 in reply to 48836
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

     return(0);

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



Sincerely,



Gene Wirchenko



Re: Doing What You Say, Saying What You Do

2005-10-31 14:37 • by mrsticks1982
48845 in reply to 48833

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


 

Re: Doing What You Say, Saying What You Do

2005-10-31 14:45 • by theDrip
Alex Papadimoulis:
function return_false()
{
return false;
}

function return_opposite_of_search_list($search_list)
{
if ($search_list == '0') return true;
return false;
}




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



Original:

function return_opposite_of_search_list($search_list)
{
if ($search_list == '0') return true;
return false;
}

Should be:

function return_opposite_of_search_list($search_list)
{
if ($search_list == '0') return true;
return return_false();
}



Re: Doing What You Say, Saying What You Do

2005-10-31 14:55 • by cupofT
The return_false function is needed for other functions of course, try to do:





if (IsTrue(return_false()))

{

}



without it

Re: Doing What You Say, Saying What You Do

2005-10-31 14:59 • by AndrewVos
48849 in reply to 48846

oh my god what the fuck.


tosser

Re: Doing What You Say, Saying What You Do

2005-10-31 15:01 • by emjot
48850 in reply to 48838
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.

Re: Doing What You Say, Saying What You Do

2005-10-31 15:06 • by emptyset
48851 in reply to 48844

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


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?


sincerely,


the master

Re: Doing What You Say, Saying What You Do

2005-10-31 15:20 • by GalacticCmdr
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.

Re: Doing What You Say, Saying What You Do

2005-10-31 15:23 • by Joshie
48854 in reply to 48838
Anonymous:
travisowens:

I smell another IsTrue() method next


This post is  approved





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.

Re: Doing What You Say, Saying What You Do

2005-10-31 15:24 • by BlackTigerX
48855 in reply to 48825

Anonymous:
i think he forgot

function do_nothing()
{
   return;
}


sure you meant:


return_nothing()

Re: Doing What You Say, Saying What You Do

2005-10-31 15:34 • by Joshie
48856 in reply to 48851
emptyset:

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


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?


sincerely,


the master


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

Re: Doing What You Say, Saying What You Do

2005-10-31 15:36 • by Anonymous Coward
48857 in reply to 48832
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....

Re: Doing What You Say, Saying What You Do

2005-10-31 15:39 • by Anonymous Coward
48858 in reply to 48855
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;
}

Re: Doing What You Say, Saying What You Do

2005-10-31 15:40 • by Richard Nixon
48859 in reply to 48844
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

     return(0);

?  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

Re: Doing What You Say, Saying What You Do

2005-10-31 16:07 • by Manni
48864 in reply to 48858
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.

Re: Doing What You Say, Saying What You Do

2005-10-31 16:12 • by Gene Wirchenko
48865 in reply to 48864
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




Re: Doing What You Say, Saying What You Do

2005-10-31 16:23 • by Sean Fisher
The WTF here is clearly, The Dog.

Re: Doing What You Say, Saying What You Do

2005-10-31 16:23 • by Maurits
48867 in reply to 48864
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

Re: Doing What You Say, Saying What You Do

2005-10-31 16:31 • by Gene Wirchenko
48870 in reply to 48867
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



Re: Doing What You Say, Saying What You Do

2005-10-31 16:32 • by 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.  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.



Re: Doing What You Say, Saying What You Do

2005-10-31 16:40 • by emptyset
48872 in reply to 48865

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


hyuk hyuk!  that was knee-slapping funny!


sincerely,


the kung foo superstar

Re: Doing What You Say, Saying What You Do

2005-10-31 16:40 • by Manni
48873 in reply to 48867
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.

Re: Doing What You Say, Saying What You Do

2005-10-31 16:42 • by Grant
48874 in reply to 48864
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){}


}

Re: Doing What You Say, Saying What You Do

2005-10-31 16:44 • by Grant
48876 in reply to 48874
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

Re: Doing What You Say, Saying What You Do

2005-10-31 16:44 • by Manni
48878 in reply to 48873

...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

Re: Doing What You Say, Saying What You Do

2005-10-31 16:47 • by Manni
48880 in reply to 48871
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?

Re: Doing What You Say, Saying What You Do

2005-10-31 16:49 • by emptyset
48881 in reply to 48873

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.


i run my code on black holes all the time.  sometimes i pay them, too, with my fistful of yen.

Re: Doing What You Say, Saying What You Do

2005-10-31 16:52 • by emptyset
48882 in reply to 48880

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


dude, you're into pregnant chicks?  that's sick.

Re: Doing What You Say, Saying What You Do

2005-10-31 17:17 • by Fizzl
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;



Re: Doing What You Say, Saying What You Do

2005-10-31 17:18 • by ferrengi
Alex Papadimoulis:

function return_opposite_of_search_list($search_list)
{
if ($search_list == '0') return true;
return false;
}




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



Re: Doing What You Say, Saying What You Do

2005-10-31 17:42 • by kipthegreat
function return_false()

{

  return !return_true();

}





function return_true()

{

  return !return_false();

}

« PrevPage 1 | Page 2 | Page 3Next »

Add Comment