- 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
What's wrong with that piece of code? isn't that standard C++?
Admin
Seriously, are you not familiar with filenotfoundian algebra?
Admin
"... I will succumb to my own false dichotomies!"
You should adjust that third value to "InMyOtherJacket". It makes the output easier:
<font size="2"> The answer is _____.
</font>
Sincerely,
Gene Wirchenko
Admin
Obviously there are never 2 choices...always 3.
True, False, or FileNotFound
black, white, or apple
yes, no, or car
paper, plastic, or shoe
-ds
Admin
or indeed true, false or null...
Admin
All my apps have the following enum:
public enum MostlyBool
{
True,
False,
KindaSortaNotReally
}
Admin
This guy and his fuzzy logic are way too advanced for my limited mind.
Admin
In one app of mine, to see if the user can edit fields in a form:
public enum Editable { YES, NO, DISABLED, READONLY; }
The last three values mean "no" :)
Admin
<!--StartFragment -->
No, I will not succumb to your FileNotFound dichotomies!
[image]
Admin
Const True as Int = -1
Const False as Int = 0
Const Maybe as Int = 0.5
Admin
...and later on down the code there is the ubiquitous IsTrue() function.
Admin
We all know this is wrong ...
Should have been
Admin
I'm surrounded by code written by morons. Complete... utter... morons. Just... oh fu** it nevermind. Just look:
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="<snip>")]
public enum BoolEnum
{
/// <remarks/>
@false,
/// <remarks/>
@true,
}
Admin
The problem with opponents of basic modal logic, of course, is that proponents of ulterior transmogrified logic systems must use modal logic to base their preposterous arguments… arguments which appear to resemble something, when consumed, tastes entirely unlike tea.
Admin
<FONT face=Verdana size=1>The more subtle WTF is that, by default, True is 0 and False is 1. Which is completely bass-ackwards.</FONT>
Admin
<FONT face="Courier New" size=2>wait, wouldn't this assign:</FONT>
<FONT face="Courier New" size=2>True <- 0
False <- 1
FileNotFound <- 2</FONT>
<FONT face="Courier New" size=2>in C/C++? what language is this?</FONT>
Admin
<FONT face="Courier New" size=2>i would like to transmogrify into a tiger.</FONT>
Admin
My favorite part about this is the following:
int main() {
if(True) {
printf("True is true\n");
}
if(False) {
printf("False is true\n");
}
if(FileNotFound) {
printf("FileNotFound is true\n");
}
}
Admin
I was wondering the same thing, since Bool is a reserved word in Java/C#... they superceded the Bool class?!?!! wtf?!?!! Now you have System.Boolean and WTF.Bool. How con-vieeeeeeeeeeean-yant.
Admin
Transform!
More than meets the eye!
Admin
Aha!
In UNIX, everything is a file!
memory, devices, process info, PCI bus... and, uh, files (duh!)
So, this makes perfect' sense!
': enum {perfect = 0};
Admin
idiot!
True, False, HowTheHellDidThisHappen
Admin
North, South, or Dennis
Admin
Admin
boolean, not Bool, is reserved in Java as a primitive type, and there's also a Boolean class. I don't know about C#. In C/C++ it depends on compiler if it's even supported, but for every compiler I've worked with it is bool, not Bool, that is reserved.
Sincerely,
I'm cooler than Gene W-name
Admin
May be part of his brain is in a quantum universe... He's trying to add another dimension to our world !!!
Admin
And in Soviet Russia, the file is you!
Admin
Er, wouldn't that be a trichotomy ?
Admin
Er, wouldn't that be a trichotomy? (One of these days I'm going to get quoting right)
Admin
OK, I give up. What about HTML?
Admin
Below the writing area, there are two options: "design" and "HTML". Select the "HTML" option. Use a browser that can render the options, like Internet Explorer. Remember to use & for &, > for >, < for <, etc. and <p> tags for nice paragraphs and <pre> tags for code.
Admin
0, 1, and sqr(-1)?
Admin
Actually, you should use <blockquote><pre> </pre><blockquote> for blocks of code.
And <code> for inline code, such as
variables
ofone-liners
.BTW, Firefox handles that just fine.
Admin
Bah, forgot to close the blockquote, and s/of/or.
Admin
Us SQL developers know this should really be
Admin
No no - it's almost, but not quite, entirely unlike tea.
Thus spake the Holy Prophet of Douglas Adams.
Admin
0.5 as an Integer..... very interesting! ^o)
Admin
Us Electronic Engineers now that it should really be
Admin
That would be:
enum Bool{
VCC,
GND,
Z
}
Admin
We have languages wherein "everything" non-zero is "true" ... at least this one uses an enum to limit the choices. Since the language in this WTF seems a little ambiguous (C/C++? Java?), let's at least hope it's a type enforcing language.
It does explain some of the stranger "file not found" messages I get :) Have we already forgotten "An unnamed file was not found"?
[Any other 'unregistered' users noting the captcha verification misses the first word sometimes?]
Admin
In the fashion of fuzzy logic, I say he updates this code to be "True", "False" and "Maybe".
Admin
Admin
Whose turn is it to explain why this isn't all that bad after-all?
Admin
What about "maybe"?
Admin
"I will not succumb to your FileNotFound dichotomies!"
Admin
But... what does IsTrue(KindaSortaNotReally) return? We need another level of the enum for... "Probably"
Admin
I'll take a stab. This looks like C++. Maybe he's used to coding with HResults. If that's the case, he's used to 0 meaning "good", negative meaning "error", and positive meaning "warning". Maybe this Bool type is supposed to be an HResult.
It's interesting that he could define IsTrue something like this:
<font size="2">bool IsTrue(Bool b) { return !b; }</font>
Admin
I don't think people are seeing the value in this.
In standard logic, the statement "all deep-sea dwelling elephants can fly" is true. With this addition, the answer is now FileNotFound; a much more satisfying answer.
Admin
In that case it's a WTF for calling it a bool.
Admin
UNIX would beg to differ: