| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
man that is Crazy..
from now on that is how we are gonna do things here at the office. |
|
(boggles)
What is a $search_list ? |
|
I smell another IsTrue() method next This post is |
|
What's wrong with this? How else are you going to get the value of false over SOAP? You need a function to call!
|
|
i think he forgot
function do_nothing() { return; } |
|
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. |
result_type switch_on_value(value case1 case2 ... result1 result2 ...) behold mortals! maintable code! |
|
return_false should have a parameter: function return_false($false = false) |
|
LOL Ok my co-worker figured out why he does this.
it is actually simple. this was written the day after his lobotomy. |
|
Why on Earth are these necessary? Just 'cuz .
function return_signature($SIGNATURE): 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
|
|
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
|
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
|
|
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
|
|
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
|
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
|
|
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
|
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
|
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
|
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
|
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
|
Agreed, if you work to hard in the CS world, you are doing too much
|
The big problem I see is that he's not reusing his own functions. Original: function return_opposite_of_search_list($search_list) Should be: function return_opposite_of_search_list($search_list) |
|
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
|
|
oh my god what the fuck. tosser |
Re: Doing What You Say, Saying What You Do
2005-10-31 15:01
•
by
emjot
|
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
|
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 |
|
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
|
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
|
sure you meant: return_nothing() |
Re: Doing What You Say, Saying What You Do
2005-10-31 15:34
•
by
Joshie
|
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
|
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
|
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
|
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
|
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
|
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 |
|
The WTF here is clearly, The Dog.
|
Re: Doing What You Say, Saying What You Do
2005-10-31 16:23
•
by
Maurits
|
Now explain why sizeof(void) == 1 |
Re: Doing What You Say, Saying What You Do
2005-10-31 16:31
•
by
Gene Wirchenko
|
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 |
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
|
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
|
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
|
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
|
DOH! I meant 1==1 |
Re: Doing What You Say, Saying What You Do
2005-10-31 16:44
•
by
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 |
Re: Doing What You Say, Saying What You Do
2005-10-31 16:47
•
by
Manni
|
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
|
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
|
dude, you're into pregnant chicks? that's sick. |
|
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; |
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 |
|
function return_false()
{ return !return_true(); } function return_true() { return !return_false(); } |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |