• Brian (unregistered)

That's just like my tri-level house that has four levels with the basement.

• Boris (unregistered)

A good TS_INTRADAY to you, sir!

• Ouch! (unregistered)

• Boris (unregistered) in reply to Ouch!

Why, it's TS_NO - 1.

• Scott (unregistered)

So how many choices are there for a 5-state?

• Alargule (unregistered)

FileNotFound, I guess?

• (cs)

It used to be true tri-state until the Senior Software Consultant changed the original code(see below).

```    enum TRI_STATE
{
TS_UNKNOWN = FileNotFound,
TS_MORNING = 0,
TS_EVENING = 1,
TS_NO = TS_UNKNOWN & TS_MORNING;
};

```
• a care-bear (unregistered)

NOBODY CARES

...like a bear

• Jumble (unregistered) in reply to Scott
Scott:
So how many choices are there for a 5-state?

Perhaps it goes up by primes? A five state enum would have seven options, and a seven state enum (say, days of the week) would have a full eleven options to work with.

• whatever (unregistered)

So a 2-state has 3 states, and a 3-state has 5. I suppose the real question here is whether the true number of states in an n-state grows linearly or exponentially.

Because if it's exponential, I pity anyone who encounters a 9-state object.

• Mike D. (unregistered)

Okay, now it makes sense. They have an engineering overdesign factor of 50%:

statesImplemented(statesSpecified) = ceil(statesSpecified * 1.5) statesImplemented(2) = ceil(2 * 1.5) = ceil(3) = 3 statesImplemented(3) = ceil(3 * 1.5) = ceil(4.5) = 5

• Mike D. (unregistered) in reply to whatever
whatever:
So a 2-state has 3 states, and a 3-state has 5. I suppose the real question here is whether the true number of states in an n-state grows linearly or exponentially.

Because if it's exponential, I pity anyone who encounters a 9-state object.

Yeah, that's a concern. It's hard to tell with only two data points. However, I think that it's more likely to be linear than exponential since people prefer O(N) algorithms over O(exp(N)).

• whoami (unregistered)

2 -> 3 3 -> 5

It's Fibonacci.

• Josh (unregistered)

people may like linear algorithms, but on this site they're more likely implemented in an exponential manner.

• grzlbrmft (unregistered)

... mostly harmless

```    enum TRILOGY_H2G2 {
TS_THGTTG,
TS_TRATEOTU,
TS_LTUAE,
TS_SLATFATF,
TS_MH,
TS_AAT
};
```
• silent d (unregistered)

This code only works within the tri-state area.

• IDKFA (unregistered)

Where's TS_IDSPISPOPD?

• The Real Jason (unregistered)

Ok, now it makes sense, I always wondered how movies like Friday The 13th that were originally a trilogy have ended up with more than three!

• Kiwi (unregistered)

It could be possible that TRI_STATE is an enumerator for "TRansaction Identification(type)", or something else with an I. Making this a nonsense WTF...

• Emoticon Man (unregistered)
enum TRI_STATE { TS_UNKNOWN, TS_MORNING, TS_EVENING, TS_INTRADAY, TS_NO };

}; indeed

I think the formula is double it and subtract 1.

2 -> 4 -> 3 3 -> 6 -> 5 5 -> 10 -> 9

• (cs)

♫ Every TS_MORNING, every TS_EVENING, ain't we got fun? ♫

• (cs) in reply to whatever
whatever:
So a 2-state has 3 states, and a 3-state has 5. I suppose the real question here is whether the true number of states in an n-state grows linearly or exponentially.

Because if it's exponential, I pity anyone who encounters a 9-state object.

That's the enum holding all the state names of the USA.

• KittyKat (unregistered)

Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

• (cs)

Meme status in 3...2...1...

• Some guy (unregistered) in reply to KittyKat
KittyKat:
Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

Six books. See above.

• MrT (unregistered) in reply to whatever
whatever:
So a 2-state has 3 states, and a 3-state has 5. I suppose the real question here is whether the true number of states in an n-state grows linearly or exponentially.

Because if it's exponential, I pity the fool who encounters a 9-state object.

FTFY

• KittyKat (unregistered) in reply to Some guy
Some guy:
KittyKat:
Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

Six books. See above.

5 true books, and one by another author

• grzlbrmft (unregistered) in reply to KittyKat
KittyKat:
Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

There's a sixth one - kind of. I just read ISBN-10 1401323588. It wasn't too bad.

• Josephus (unregistered)

haha... someone named a variable to represent 3 items and then added some more without changing the variable.. cool story bro.

What next, someone putting a spelling mistake in a comment?

• KittyKat (unregistered) in reply to grzlbrmft
grzlbrmft:
KittyKat:
Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

There's a sixth one - kind of. I just read ISBN-10 1401323588. It wasn't too bad.

it was good, a descent book by a descent author, but didn't quite fit the Trilogy in my mind

• By-goat (unregistered)

this is just like the five book trilogy - Hitch Hikers Guide to the galaxy

• TarMil (unregistered)

2 -> 3; 3 -> 5. With no doubt possible, it's Fibonacci. So a 5-state (or penta-state) would have 13 states. Also, the US has 32951280099 states.

• Shriike (unregistered)
if Booleans have three states, what does that make a Tri-State?
Doesn't that statement seem to imply that Boolean's name implies 2? Since Boolean is just named after a mathematician (George Boole), it is clear that originally he intended for 3 values, true, false, and file not found. So clearly that all makes sense, and this Tri-State enum is a totally unrelated WTF.
• (cs) in reply to TarMil
TarMil:
2 -> 3; 3 -> 5. With no doubt possible, it's Fibonacci. So a 5-state (or penta-state) would have 13 states. Also, the US has 32951280099 states.

Nope, wrong. It's the n'th prime number. 1 -> 2 2 -> 3 3 -> 5 4 -> 7 5 -> 11 etc.

• John Preston (unregistered) in reply to Mike D.
Mike D.:
whatever:
So a 2-state has 3 states, and a 3-state has 5. I suppose the real question here is whether the true number of states in an n-state grows linearly or exponentially.

Because if it's exponential, I pity anyone who encounters a 9-state object.

Yeah, that's a concern. It's hard to tell with only two data points. However, I think that it's more likely to be linear than exponential since people prefer O(N) algorithms over O(exp(N)).

I don't believe the kind of people to have a 5 state Trinary enumeration are the kinds who would prefer less of anything. I'm pretty sure they would like exponential algorithms.

• (cs)

This one almost makes sense. Almost.

TS_UNKNOWN could be a variation on a stock first item in every enum for handling errors and other exceptional cases. As the first item, it should have the value of 0. That conveniently makes it the only false enum value giving rise to constructs like:

```if (! tristate) {
// Error here
} else {
...
}
```

And if we assume that the "NO" in TS_NO is actually an abbreviation of "number" rather than the English negative, then it makes a bit more sense. Similar to *_UNKNOWN being a stock first item in each enum, *_NO could be a stock last item so that its value can be used to automatically calculate the number of values in the enum. It does have some disadvantages (TS_UNKNOWN is included in the count and TS_NO creates an invalid state that the enums shouldn't be set to), but it does theoretically serve a useful purpose. Of course in an ideal world, the programming language would provide a mechanism for figuring out how many values are in an enum and TS_NO would be unnecessary.

Once we've excluded what appear to be stock enum values (possibly mandated by the coding style in use), what's left does properly fit the tristate label. So it's a little ugly, but there's a potentially reasonable explanation for everything.

Of course calling it a tristate is still a WTF since the enum values imply it's a lot more specific than just involving 3 states.

• Anonymous Coward (unregistered)

Theres also the boolean mysql enum, if you create one that can be ('true','false') you'll find it is actually: ('true','false',NULL) even if you set the default to be 'false'...

NULL == FILENOTFOUND?

• lesle (unregistered)

For those of us old enough to remember, and before the widespread advent of computers, noon was 12 m. and midnight was 12 p.m. There was no 12 a.m. But computers are binary/two-state. So now noon is 12 p.m. and midnight is 12 a.m. Arrgh!

This change also ignores the question of how can there be an a.m. and a p.m. without an m. to give them meaning? For you young whippersnappers who don't get this, tempus fugit.

And in days of yore, printed schedules for buses and trains, by convention, printed a.m. times in light face and p.m. times in bold face. Again, binary/two state. And also why there were so many arrivals at 11:59 (light face) and so many departures at 12:01 (bold face).

• (cs) in reply to lesle
lesle:
For those of us old enough to remember, and before the widespread advent of computers, noon was 12 m. and midnight was 12 p.m. There was no 12 a.m. But computers are binary/two-state. So now noon is 12 p.m. and midnight is 12 a.m.
To be fair, the current system is pretty simple: midday is 12pm because then it has the same suffix as the remainder of the hour (including 12:00:01, which has got to be after midday, yes?) Mind you, I'm just moving over to using the 24-hour clock wherever I can.
• (cs) in reply to Josephus
Josephus:
haha... someone named a variable to represent 3 items and then added some more without changing the variable.. cool story bro.

What next, someone putting a spelling mistake in a comment?

Yup, and calling it "vestigial."

• (cs)
enum TRI_STATE { TS_UNKNOWN, TS_MORNING, TS_EVENING, TS_INTRADAY, TS_NO };
From what I can tell, it kind of makes sense... Almost.

TS_MORNING = Submitted after midnight, but before business hours TS_EVENING = Submitted after business hours, but before midnight TS_INTRADAY = Submitted during business hours TS_NO = Not submitted at all (possibly an internal note? TS_UNKNOWN = Unsure of the submission time

The use would be in a ticket tracking system, to differentiate the number of tickets that come in by the time (so you can charge differently for each "time period")...

Now, as far as the name "TRI_STATE", I can think of 2 possibilities. Either TRI == three, and TS_NO and TS_UNKNOWN were added post-deployment as it was found they were needed. The other possibility is that TRI == 'Transaction Scheduling Information' or something like that...

Some documentation would be nice (since it's not obvious what it's talking about), but other than that, it CAN be justified (obviously without seeing how its used, it's hard to see if it's a real WTF)...

• Thg (unregistered) in reply to KittyKat
KittyKat:
grzlbrmft:
KittyKat:
Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

There's a sixth one - kind of. I just read ISBN-10 1401323588. It wasn't too bad.

it was good, a descent book by a descent author, but didn't quite fit the Trilogy in my mind

I think what you mean to say is that the sixth book is "almost, but not quite, entirely unlike" the Hitchhiker's Trilogy

• jdw (unregistered) in reply to Jumble
Jumble:
Scott:
So how many choices are there for a 5-state?

Perhaps it goes up by primes? A five state enum would have seven options, and a seven state enum (say, days of the week) would have a full eleven options to work with.

Someone's counting 1 as a prime. Tsk, tsk. (And what's this prime that exists between 7 and 11?)

• Zed (unregistered) in reply to grzlbrmft
There's a sixth one - kind of. I just read ISBN-10 1401323588. It wasn't too bad.
Wow, did you really just name a book for us by it's ISBN rather than it's title? That's hardcore. I'm going to try that in conversation over by the water cooler and see what happens.
• (cs) in reply to Some guy
Some guy:
KittyKat:
Obviously the code writer was a fan of Hitch-hikers Guide to the Galaxy, the 5 book trilogy.

Six books. See above.

What about Young Zaphod Plays It Safe which was added as a sixth sort of novella to the last compendium I had in my possession (the disappearance of which is rather a sore subject). Granted, not a book in it's own right, but a true H2GT2G story nonetheless and in the same series. Does that make seven? Or does the removal of AAT and insertion of YZPIS make six still?

• (cs) in reply to jdw
jdw:
Jumble:
Scott:
So how many choices are there for a 5-state?

Perhaps it goes up by primes? A five state enum would have seven options, and a seven state enum (say, days of the week) would have a full eleven options to work with.

Someone's counting 1 as a prime. Tsk, tsk. (And what's this prime that exists between 7 and 11?)
You haven't heard of that? I thought everybody knew about .... bird bird bird, bird is the word (damn you family guy episode last night, damn you!!!)

• (cs) in reply to Thg
Thg:
I think what you mean to say is that the sixth book is "almost, but not quite, entirely unlike" the Hitchhiker's Trilogy
QFT
• fnord (unregistered) in reply to lesle
lesle:
For those of us old enough to remember, and before the widespread advent of computers, noon was 12 m. and midnight was 12 p.m. There was no 12 a.m. But computers are binary/two-state. So now noon is 12 p.m. and midnight is 12 a.m. Arrgh!
I may be old, but all I remember is a 12:00 and a 24:00 ;-)
• (cs) in reply to jdw
jdw:
(And what's this prime that exists between 7 and 11?)

9'. It looks like 9, but it hails from an alternate dimension in which 3 was never born. Also, it has a goatee and is evil.