| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
|
trueandorfalse?
WTF #1 is not knowing the ! operator. WTF #2 is not knowing that the logical operation you are doing is called "not". WTF #3 is not handling FILE_NOT_FOUND. |
|
Why is it called trueandorfalse() ?
|
Re: The Clever Coder
2009-10-07 10:29
•
by
eViLegion
(unregistered)
|
Because you can put True &/ False in as the input, and you'll get True &/ False as the output, presumably. This is one of the best things I've ever seen. |
|
A real coder would have done:
return xor(_booInpt,1); Obvious really... |
|
At least it's well documented, and even has a touch of humor (Scientology wtf?)
|
|
This comment is clever... NOT!
|
|
reminds me of a
if((!shouldContinue) == false) { // blah.... } I saw one time. Suddenly the death penalty seems sort of reasonable in extreme situations. |
|
The fool! He needs another if!
/// <summary> /// Turns true into false and false into true /// -- similar to the church of scientology. /// <param name="_booInpt">True of false</param> /// <returns>False or true</returns> private bool trueandorfalse(bool _booInpt) { // I'm quite sure though there is a very // clever C# standard command doing this, // I just can't find it right now ... if (_booInpt == true) return false; if (_booInpt == false) return true; } Looks like I caught this one just in time! :) |
Re: The Clever Coder
2009-10-07 10:37
•
by
Lisa McPherson
(unregistered)
|
The Church of Scientology is a very dangerous organization. http://en.wikipedia.org/wiki/Lisa_mcpherson http://en.wikipedia.org/wiki/Operation_Freakout http://en.wikipedia.org/wiki/Operation_Snow_White Be very careful how you decide to engage them. |
Re: The Clever Coder
2009-10-07 10:37
•
by
flyboyfred
(unregistered)
|
I think you mean, "trueandorfalse(clever)". |
LMAO greatest comment ever |
// converts true to false and false to true Extra credit to those who actually counted! |
|
What about FILE_NOT_FOUND?
|
|
TRWTF is Microsoft thinking that using XML for comments was a good idea.
|
What if the boolean isn't true or false though?
|
Thank goodness someone knows that you have to make sure the computer really gets it. But just to make sure, you should return it again, in case the computer missed the return statement the first time. :) Also... 47. Extra credit |
|
The real WTF is when a decent compiler doesn't turn this method call into a simple ! operation.
|
|
XML is a good idea for EVERYTHING.
|
Re: The Clever Coder
2009-10-07 11:06
•
by
Rodnas
(unregistered)
|
It is great joke. I like. Tjenkoeje. |
|
trueandorfalse(its) only that the coder trueandorfalse(does) know the basic operands, but he also feels he trueandorfalse(could) be bothered to look for them at the moment.
but he is somehow capable of endless trueandorfalse(wit) in his comments. |
|
Countdown to Alex being sued, murdered, or falsely discredited for being a sexual deviant:
10:01:59... 10:01:58... 10:01:57... 10:01:56... |
|
The lawyers at the Church of Scientology have been notified and will sue the pants off of Alex, the original author of this posting, and the original author of the code.
Addendum (2009-10-07 11:21): The lawyers at the Church of Scientology have been notified and will sue the pants off of Alex, the original author of this posting, and the original author of the code. Katie Holmes will represent the church in court and will appoint Tom Cruise as the judge. If you accuse them of bias by attempting to appoint a fellow follower as the judge, they shall sue you a second time. |
Re: The Clever Coder
2009-10-07 11:16
•
by
Wheaties
(unregistered)
|
|
I've seen this before unfortunately. Only it's been 1 to 0 and 0 to 1 instead of using the built in boolean of the language.
|
Re: The Clever Coder
2009-10-07 11:19
•
by
trueandorfalse(nobody)
(unregistered)
|
Maybe he DID look for some built-in operator for the "andor" operation, but didn't find anything... |
|
What is the "true of false"? Is there truth in falsehood?
|
Re: The Clever Coder
2009-10-07 11:21
•
by
Tom Cruise
(unregistered)
|
I'm a Scientologist, you insensitive clod! |
And even then, trivial to invert with "value = 1 - value". You used to see that a lot in old BASIC programs. |
Re: The Clever Coder
2009-10-07 11:24
•
by
lawlsci
(unregistered)
|
Calm down, don't go all Sci-Fi on him! |
|
GREATEST. WTF. EVER.
|
!!! |
Re: The Clever Coder
2009-10-07 11:32
•
by
Anon
(unregistered)
|
You fail on your last use of trueandorfalse. wit not? not wit? trueandorfalse(does) make sense. |
Like this? bool invert(bool b) Now, about the halting problem... |
Re: The Clever Coder
2009-10-07 11:33
•
by
silent d
(unregistered)
|
|
From now on, I'm outsourcing all my development work to the Church of Scientology. I mean, at least they admit their Book was written by a science fiction author.
|
I have seen worse: if((!notShouldContinue) == false) Good luck. |
I hope you are joking. ... couldn't resist. CAPTCHA: secundum. !primum |
QFT. Fired. |
|
I'm quite sure there is a very clever post commenting this, I just can't find it right now ...
|
That one was intended as a "...endless wit (not!) .." sort of thing. |
Re: The Clever Coder
2009-10-07 11:52
•
by
NotNotWhat
(unregistered)
|
|
|
The googles....they do nothing!
Captcha: plaga... like the RE:4&5 plot device. |
Re: The Clever Coder
2009-10-07 11:55
•
by
martiert
(unregistered)
|
|
Yeah. Only problem is that the compiler won't like this since you use an if instead of an else. So it might get to the end of the function without returning anything. Solution: throw an exception!
|
Of course he is. That code wouldn't even compile, the stupid compiler complains that not all code paths return a value... 8-| |
|
I have frequently seen code that is clearing trying to initialize a flag that looks like this:
if (flag==true) flag=false; I've seen this from multiple programmers at different companies, like they must either teach this in school somewhere or it's a common form of mental illness. What, you think that it will take the computer longer to set the flag to false when it's already false then it would to first check if it's true? Actually the reverse is almost certainly the case. Or are you just being careful not to set it to false when it's currently FILE_NOT_FOUND? Ditto on: if (amount1!=0) total=total+amount1; Yeah, we want to save the computer from having to add the two numbers together if one of them is zero. Except, the "if" almost surely takes longer than the plus, so if it's not zero, the "if" is completely superfluous wasted time, and if it is zero, you've still taken longer than just adding it in. |
|
Well, actually, it DOES do something more than the NOT operator (!) does.
It maps values that are EXACTLY equal to "true" to false, everything else maps to true. If we assume that the incoming value might have come from an unsafe source, and might contain any random value, then it does do something slightly different than (!) Not that that makes it any better. |
|
If it wasnt for the amusing "similar to the church of scientology" text, I would fire this person on the spot.
|
Re: The Clever Coder
2009-10-07 12:19
•
by
Neo31337
(unregistered)
|
LOL! I haven't laughed this hard in a long time. |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |