- 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
man that is Crazy..
from now on that is how we are gonna do things here at the office.
Admin
(boggles)
What is a $search_list ?
Admin
<FONT face=Garamond>I smell another IsTrue() method next</FONT>
<FONT face=Garamond>This post is [image] approved</FONT>
Admin
What's wrong with this? How else are you going to get the value of false over SOAP? You need a function to call!
Admin
i think he forgot
function do_nothing()
{
return;
}
Admin
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.
Admin
<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>
Admin
return_false should have a parameter:
Admin
LOL Ok my co-worker figured out why he does this.
it is actually simple.
this was written the day after his lobotomy.
Admin
Why on Earth are these necessary? Just 'cuz .
:Admin
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????!!!!??"
Admin
nope.. I think it would be ...
function return_nothing()
{
return;
}
Admin
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."
Admin
Nutz, I didn't really mean to write a recursove deposit_paycheque...
Dang. If only this forum had 'edit' enabled.
Admin
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"
Admin
Wow, it's like the orginial programmer didn't know the concept of 'return' ...
I'd love to see the code that calls it.
Admin
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();
}
Admin
Can't forget the famous,
function return_click2($click2){
if($click2)
return return_true();
else
return return_false();
}
Admin
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
Admin
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
Admin
Agreed, if you work to hard in the CS world, you are doing too much
Admin
The big problem I see is that he's not reusing his own functions.
Original:
Should be:
Admin
The return_false function is needed for other functions of course, try to do:
if (IsTrue(return_false()))
{
}
without it
Admin
oh my god what the fuck.
tosser
Admin
Brillant! This ,,vice_versa'' part of function name takes my mind into new dimension. Let me out.
Admin
<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>
Admin
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.
Admin
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.
Admin
sure you meant:
return_nothing()
Admin
Are you saying that in c you aren't allowed to call return without parens? gcc will let you compile a return without parens
Admin
dang, got it wrong.
of courser
function return_nothing(var nothing)
{
return nothing;
}
is more to this coders standards....
Admin
shoot, i think i mean this instead:
function return_nothing($NOTHING)
{
return $NOTHING;
}
Admin
That's pretty wild Gene. Did you set them straight in the usual Gene-fashion?
Sincerely,
Richard Nixon
Admin
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.
Admin
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
Admin
The WTF here is clearly, The Dog.
Admin
Now explain why sizeof(void) == 1
Admin
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
Admin
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.
Admin
<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>
Admin
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.
Admin
This function should work for you:
function return_nothing($NOTHING){
while(1==0){}
}
Admin
DOH! I meant 1==1
Admin
...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
Admin
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?
Admin
<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>
Admin
<FONT face="Courier New" size=2>dude, you're into pregnant chicks? that's sick.</FONT>
Admin
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;
Admin
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
Admin
<font size="2">function return_false()
{
return !return_true();
}
function return_true()
{
return !return_false();
}
</font>