- 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
I'm sure that no one will see this but,
you aren't comparing apples to apples. The obj1.vote says to me if the person chose to vote not how they votes. Get it right! A vote would be yes or no or abstain. NOT A BOOLEAN!!!!!!!
Admin
Makes perfect snese to me, Vote is not a boolean. It has three possible values. For, Agasint, Abstaine.
It's like the earlier example where somone was trying to apply values which apply to boolean values to Gender.
Admin
I agree - this is not a WTF at all.
Admin
Haven't you been paying attention? This is a major WTF.
Think about it: A bool is the putative assertion that a given statement is true. The statement "Person X is female" is either true or false. This is not semantically equivalent to "What is Person X's gender?": The answer to that is either "Male" or "Female", neither of which are boolean values.
What's the name of the attribute in the Person entity? If it's "IsFemale", then it can be a bool. I doubt that's the case; typically it's "Gender", which is not a bool, and should be an FK from a Gender entity, or simply strings (e.g. "M" or "F")
Admin
Amen. Church is now out.
Admin
Sorry. It was a really, really long day. . .
all those bullets to polish. . .
Admin
http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.tristate.aspx
Admin
So? Are you holding up VB as a shining example of syntactical & semantic clarity?
In any case, your post is a WTF since the TriState is a different type with a different purpose than a bool. It can't simply be used in place of a bool (or whatever VB calls it), and it doesn't have the same semantics as the enum defined in this WTF.
Admin
While some of these values are mutually exclusive for an order, any combination of theses statuses can apply to a given set of orders. In warehousing, sometimes the program has to handle sets of orders. Trust me. Therefore, this design might be reasonable.
BOOL obviously is a acronym for Brillant Obstruction Of Logic
Admin
Probably a default value for the database, if they don't know if it should be true or false.
But it should be named troolean or something :)
Admin
true
Admin
»Is this BRILLANT or not?«
Brillant or not? This is a yes/no question that can be answered with a boolean. I'de say BOOL.NEITHER_TRUE_OR_FALSE;
Admin
According to SNL, that would be best implemented as:
Admin
What happens when the state doesn't change then? The only way to assure that the cat is dead is when you put it in for an infinite amount of time... Plus, what is with the maybe thing on the end? Now you're just contradicting yourself. If we just assume for a minute that everything is false when it isn't observed then we can just assume that everytime we blink the universe decays. Anyways, someone once told me don't assume or you'll make an ASS out of yoU and ME. I'm sure this is some form of rule breaking... So I can probably say bye bye post...
Admin
"Brillant or not? A yes/no question, I'd say NEITHER_TRUE_OR_FALSE"?
Wait, so that means...
The question is "Is it brillant or not?"
If I say "yes", that means that either it is brillant, or it is not brillant, or both (assuming the OR is inclusive).
If I say "no", that means that it is both not brillant, and not not brillant.
But it's neither yes nor no.
So therefore it isn't (either brillant or not or both), and it isn't (both not and not not brillant), so what is it? 42? Javascript? XML? Perhaps it's file-not-foundedly brillant with juice.
Admin
For what it's worth, gender is a tri-state. Everyone has a gender, and it is conventionally given as male, female or indeterminate in humans.
What was someone saying about null?
Admin
Shouldn't it be
NOT_TRUE_OR_NOT_FALSE
Get your boolean operations straight, it should obviously be NOT_TRUE_AND_NOT_FALSE
Admin
Ok, how do we know the universe doesn't decay every time we blink?
Seriously though (might be difficult because this is not a totally serious thread) My example shows that most of the time you can default (or assume) the value of an unknown as in my example above, but there is an exception to every rule, as much as this can be called a rule, as your example shows. In truth, my example shows a boolean representation with a third unknown value that is easily interpreted as one of the TWO boolean states. You example, in contrast, shows not a boolean but rather an enumurated value. Once you take a presumably 2 state value and recognize a third state as having a different meaning from the previous two, you are no longer talking boolean but rather a more extensive enumeration.
Following this logic, a boolean is an enumeration, but an enumeration is not a boolean, just as a square is a rectangle but a rectangle is not a square. A boolean is just a bi-state enumeration, anything greater is an enumerator of greater proportions.
Admin
I...will...never...blink...again...blink DOH!
Admin
No, that piece of code would look like this:
enum GENDER
{
MALE,
FEMALE,
PAT
};
Admin
I think it's a bit of both. :D
Admin
Ah, yes, but this enterprising coder has (re)discovered fuzzy logic.
Admin
No WTF here.
The first enumeration is obviously using some bit mask ie. 00000001
And there is such a thing as not true or false, its called a maybe.
-- tdog
Admin
The true/false is not a WTF because in real-time systems for example it's common to have a boolean state "not yet determined" were you'd be incorrect defaulting to either true or false. Maybe form A goes up if the field is true, form B goes up if false, but if not yet determined you don't put up either. He could have maybe renamed it to that, but if everybody in the shop is used to that I think it's clear enough.
The bit fields isn't a WTF either but there may be easier ways today. It's from embedded or C days back when you had to count every byte. With space not so much an issue it's probably better to use booleans so you get more readable code like if (Order.Status.bIsOpen && Order.Status.bIsRejected) instead of if (Order.Status & (Open | Rejected)) but the latter is certainly understandable and used in certain shops.
Admin
Even if that was what it was about, the choice of 'NOT_TRUE_OR_FALSE' as an identifier is extremely stupid. It doesn't make any sense as far as boolean logic is involved. So the identifier in that case should be called something that makes sense, such as 'STATE_NOT_DETERMINED'.
For ultimately, this is also what a "WTF" is all about: even in a case of a clear design, you manage to screw it up - especially maintenance-wise - by using arbitratily inept identifiers and constructs.
Admin
bosh
Admin
Thank goodness C# 2.0 at last has the bool? datatype...
bool? b = cat.IsAlive();
Admin
a boolean algebra must have a zero-element and a one-element. it is however not necessary that these are the only elements in the set...
Admin
Which is a another WTF. This mixes the current state of the order with its history.
Admin
When you read a qubit, it has a discrete state at that instant.
That being said, I do like qubits.
Admin
pharmacie en ligne http://kamagraenligne.com/# pharmacie en ligne livraison europe