• (cs) in reply to Grovesy
    Grovesy:
    True, to my knowledge is not a Gender.


    I really want to say something about how true would obviously be male, and false would be female...but I'm afraid some of you might think I'm being sexist.  So I won't say anything at all.

    -ds
  • (cs) in reply to Derek
    Anonymous:
    P.S.  You know, this forum software is pretty much entirely nonfunctional with Firefox.  <insert comment="" about="" the="" real="" wtf=""></insert>

    I'm using FF 1.5.0.1 and it works like a champ. When I was on 1.0 it also worked nicely.
  • pmagill (unregistered) in reply to DisturbedSaint
    DisturbedSaint:
    Grovesy:
    True, to my knowledge is not a Gender.


    I really want to say something about how true would obviously be male, and false would be female...but I'm afraid some of you might think I'm being sexist.  So I won't say anything at all.

    -ds


    I guess this has to do with teh appearance of the 1 and 0.  One of them is obviously more of a phalic symbole then the other.  Of course this could be the root cuase of many fallicies.
  • mpComplete (unregistered)

    public enum BOOL
    {
    TRUE,
    FALSE,
    NOT_TRUE_OR_FALSE
    }

    The best part about this is that enums start at 0 (at least in C and C++, not sure about C#).  So TRUE is false and FALSE and NOT_TRUE_OR_FALSE are true.

  • somejackass (unregistered) in reply to Roger
    Anonymous:

    Especially wonderful is that TRUE is the first value listed, so it has a value of 0.  FALSE has a value of 1.



    Yeah, so? If the abstraction is adhered to, it's fine. In fact, unix programs use the same convention in their return values:
    $ true ; echo $?
    0
    $ false ; echo $?
    1
    This is actually the right way to do it when you have 3 truth values. To see why this sometimes make sense, consider the program grep. If it returns 0, you know you found what you were looking for. 1 means it didn't find it. 2 or greater means an error occured, and you can't treat that condition the same as false (because you can't say for sure that what you were checking for is not true - it could be that the file had the expression you were looking for, but you don't have permission to access it or somesuch). By making truth have a value of zero, you can avoid invitations to shoot yourself in the foot like the construct "if(result)", which is fine if your result is true or false, but will dump you in the same block as where true values go if you have a mu value - which 99 out of 100 times is a VERY bad thing - therefore you have to say if(result == TRUE), etc.

    There are plenty of other programming languages that don't adhere to the 1==true, 0==false method (LISP, for example).

  • (cs)

    The bitmask is not a WTF by any means.   It might not be the absolute best way to do it, but often in procurement or inventory control things can be in multiple states simultaneously.  Now, there may be conflicting states in this particular bitmask, but that's impossible to know without seeing the actual business case.  Yes, there are crazy bean counters to whom having an order in the state Rejected | Approved | PendingApproval may just make sense.  It could concievably be an order that was approved by some, rejected by others and waiting on some more people, so it goes into 3 categories and your logic goes like:

    forEach(order where orderStatus & Approved)
      if(orderStatus & PendingApproval) break; // Not everyone has given their say
      else if(orderStatus & Rejected) sendToNegotiation();
      else processApproval();

  • Chris McKenzie (unregistered) in reply to procyon112

    "So:
    Straight Enumerator for mutually exclusive values.
    Bitflags for concurrent state values."

    I think it depends on the scope of what you're talking about. I have a situation in which in the BPL the types are exclusive, but for reporting purposes I need to be able to group combinations of types on-the-fly. As long as you enforce exclusivity in the proper places it shouldn't be a problem.

  • (cs) in reply to Grovesy

    It's the UnRejected status that gets me..

    If something is UnRejected, surely it would go back to a state of  {opened, pending approval, approved, .... .etc).. with some note attached. UnRejected appears to be a terminal state.

    not necessarily. Say that there is a time limit to approve/reject something. If you don't approve or reject within the time limit, then a default action takes place. So this way, you could always go back and see whether the person actually approved/rejected it or it was just not acted upon and the default action happened.

    My WTF ruling is: Not_True_Or_False ie need more information

  • GOD (unregistered) in reply to BlackTigerX
    BlackTigerX:

    Anonymous:
    Isn't the definition of boolean 2 values?  I don't want to imagine the innards where you can have conditions that arent true or false

    whatta newbie... of course you can have more than 2 values!!

    yes, no, maybe

    true, false, NULL

    and of course

    true, false, FileNotFound

    [:P]





    Heaven, Hell, Purgatory
  • Gid (unregistered) in reply to Gene Wirchenko
    Gene Wirchenko:
    Anonymous:
    Anonymous:
    Isn't the definition of boolean 2 values?


    No. http://en.wikipedia.org/wiki/Boolean_algebra


    Quoting from that page: "A Boolean algebra is a set A, supplied with two binary operations \land (logical AND), \lor (logical OR), a unary operation \lnot (logical NOT) and two elements 0 (logical FALSE) and 1 (logical TRUE), such that, for all elements a, b and c of set A, the following axioms hold:"

    Sincerely,

    Gene Wirchenko



    He one-upped me.  He actually read the boolean algebra post.  I was just going to say "lets look at the definition for boolean"
    http://en.wikipedia.org/wiki/Boolean
  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    Anonymous:
    Anonymous:
    Isn't the definition of boolean 2 values?


    No. http://en.wikipedia.org/wiki/Boolean_algebra


    Quoting from that page: "A Boolean algebra is a set A, supplied with two binary operations \land (logical AND), \lor (logical OR), a unary operation \lnot (logical NOT) and two elements 0 (logical FALSE) and 1 (logical TRUE), such that, for all elements a, b and c of set A, the following axioms hold:"

    It can quite happily have more than two elements, though, as some of the examples on that page show.
  • Randolpho (unregistered)

    Tri-state bools are nothing new.... databases have returned null for a bool column for decades now. IMO, the only WTF there is that he's using C#, but not using C#/.NET 2.0 and nullable types, which *does* support a tri-state bool. In a way.

    http://msdn.microsoft.com/vcsharp/2005/overview/language/nullabletypes/

    No, my big WTF is the first enum. Why specify powers of 2 values, but no [Flags] attribute? If the [Flags] attribute was unintentionally left off (either by the author of this WTF article, or by the original code author), and it's intended to be a bit flag, why are there so many states that cannot possibly be valid together? Rejected & UnRejected, for example. UnRejected itself is a huge WTF. Also, what does Reject mean that Rejected doesn't handle?

  • Mick (unregistered) in reply to John Smallberries

    <font size="2">why do all this, when you can:

    String foo = new Storray( status = UnRejected ).ToString().ToString();

    if(!foo != NOT_TRUE_OR_FALSE){
      System.out(foo).ToString();
      System.out( "Paula is Brillant!" + foo );
    } else {
      System.out( "Please Compile!" );
      System.out( "Paula is Brillant!" + foo );
    }
    </font>

  • teh hee (unregistered) in reply to pmagill


    I guess this has to do with teh appearance of the 1 and 0.  One of them is obviously more of a phalic symbole then the other.  Of course this could be the root cuase of many fallicies.


    phallicies?
  • (cs) in reply to Colin

    Anonymous:
    Tri-bool: true, false, null.

    What's the problem with that?

    If you were to mark the gender of someone named "Rene" or "Chris", what would you mark it as?  Perfect instance of a boolean situation (male or female, obviously) and a third: unkown/not-sure.

    Hardly a WTF on that count.

    It's a WTF to call it a BOOL.

  • (cs) in reply to Randolpho
    Anonymous:

    ...what does Reject mean that Rejected doesn't handle?


    It's just missing the PendingRejection status.
  • (cs) in reply to Sum Fag

    Anonymous:
    Anonymous:
    Isn't the definition of boolean 2 values?


    No. http://en.wikipedia.org/wiki/Boolean_algebra

    You usually link a page that supports your assertion, not one that contradicts it.

  • Brad (unregistered) in reply to Colin
    Anonymous:
    If you were to mark the gender of someone named "Rene" or "Chris", what would you mark it as?  Perfect instance of a boolean situation (male or female, obviously) and a third: unkown/not-sure.

    But 'male or female' isn't a boolean situation at all. It's just something that 'usually' has two states, whereas a boolean 'usually' has two states. To phrase that as a boolean, you'd have to say it was either 'male? (true/false)' or 'female? (true/false)'. And then you'd have to quibble semantics with the gender crew for the rest of the project's duration.

    Three-state logic is common in logic simulation: a binary signal can either be true, false, or unknown ('x'), and that's perfectly reasonable because we can reason about thebehaviour of a circuit in the presence of unknown values ( 1 | x  is equal to 1, for instance). Of course, things get even more amusing when you add in the fourth logic state, 'z'...


    is z "I don't want to know" ?
  • Ken (unregistered)
    Alex Papadimoulis:

    public enum OrderStatus
    {
      Opened = 1,
      PendingApproval = 2,
      Approved = 4,
      PendingAuthorization = 8,
      Authorized = 16,
      PaidFor = 32,
      Reject = 64,
      Rejected = 128,
      Deleted = 256,
      Removed = 512,
      UnRejected = 1024
    }


    I love it.  Schitzophrenic orders that can be both Approved and also Rejected (4 | 128). 

    Yay!
  • Chris (unregistered) in reply to mallard
    mallard:
    Alex Papadimoulis:

    public enum OrderStatus
    {
      Opened = 1,
      PendingApproval = 2,
      Approved = 4,
      PendingAuthorization = 8,
      Authorized = 16,
      PaidFor = 32,
      Reject = 64,
      Rejected = 128,
      Deleted = 256,
      Removed = 512,
      UnRejected = 1024
    }


    Nice how he's used powers of 2 for all the possibilities...

    Would C# allow something to be (Opened | Removed) for instance?

    It would. I use this all the time to pass options to a stored procedure on types of results to return.
  • Roy (unregistered) in reply to Katabrok
    Anonymous:

    <font face="Tahoma">Thats the first and only TROOL, tri state boolean! </font>


    Not quite.  Check the MS docs for GetMessage() sometime.  Tri-state BOOL from the mid-nineties.
  • (cs) in reply to JohnO
    JohnO:

    Anonymous:
    Anonymous:
    Isn't the definition of boolean 2 values?


    No. http://en.wikipedia.org/wiki/Boolean_algebra

    You usually link a page that supports your assertion, not one that contradicts it.


    There's a difference between requiring two distinguished elements and allowing only two elements.

    The page has 6 examples of Boolean algebras with more than 2 elements, including one with a diagram.
  • Integration Nation (unregistered) in reply to Colin

    Gender is not the appropriate situation to apply boolean logic.  Chromosomally speaking, you can be boolean (presense or abscense) minded when talking about whether a Y chromosome on the sex gene exists, but in terms of physical appearance and culture, you could be dealing with an indivudual who is intersex could be classified as (Gender.MALE | Gender.FEMALE), depending on how the individual feels that day and where in his/her life (s)he is in before (optional) gender-correction surgery.

    The moral of the store is, use an enum here and put the options you need.  I would disagree with using NULL instead of an Other/Intersex value, as if you removed the person's undergarments there definately isn't NULL going on down there.  This situation occurs naturally in the population at large.

    Hope that cleared things up.

  • Keir (unregistered) in reply to mallard

    Yes, it would allow that.  It's really pretty well done, I don't see a WTF at all.  Thats someone with alot of experience to know to setup an enum to allow bitwise logic like that.

    The only wtf here is that bool enum which is named bool.  If he needed those three option he should have called it something else, like "FuzzyBool" or something.

  • Ribbly Screwspigot (unregistered)

    Personally I don't see the problem with the first enumeration, that is , if that enumeration is to represent discrete states an order can be in. I doubt it was meant to be used as a bitmask.

    For example, perhaps some condition must be true for an order to move from Opened to PendingApproval. They are simply workflow states, not to be combined -- as many of you mentioned, that would be the work of a dumbass.

    As for the "tri-state Boolean" enumeration, George Boole himself came up with our concept of on-off, yes-no, stick-circle or whatever kind of logic you may call it. There is no room in his popular work for a third state. Therefore, any attempt to "extend" Boolean logic to include a ternary state is also the work of a dumbass. Including nullable bools.

    Some people would say that a light can be on, off, or dimmed. But that's wrong. If it's dimmed, it's on. There is just another variable to say how bright the light is.

    See you in the bar,
    Ribbly

  • ChiefCrazyTalk (unregistered)
    Alex Papadimoulis:

    As we've seen here plenty of times here, one can learn a lot about a system from just peeking at a few lines of code. But many times it's the enumerations defined in the system that will tell you more than you'll ever want to know. I'll leave it as an exercise to the reader to imagine the innards of this C#-based warehousing system that P.G. had the pleasure of working with ...

    public enum OrderStatus
    {
      Opened = 1,
      PendingApproval = 2,
      Approved = 4,
      PendingAuthorization = 8,
      Authorized = 16,
      PaidFor = 32,
      Reject = 64,
      Rejected = 128,
      Deleted = 256,
      Removed = 512,
      UnRejected = 1024
    }
    ...
    

    public enum BOOL { TRUE, FALSE, NOT_TRUE_OR_FALSE }

     

    Normally I shake my head in disbelief at the WTFs posted on this site, but this isn't one of them.  For example, I could envision a separate order status for reject (order is slated to be rejected), rejected (order has already been rejected) and unrejected (was rejected once, but was overridden and restored).  And as others have mentioned,  the fact that databases allow nulls means True/False/Unknown (or whatever you would like to call the third state) actually makes sense.

     

    No Digg.

     

  • Rooster (unregistered)

    WTH

    I vote for least WTF ever on this forum.

    Almost to the degree of arguing - this is not a WTF.

  • Jon (unregistered)

    What I love is that you could have an OrderStatus value of 1152, which would be both Rejected and UnRejected....

  • Holmok (unregistered) in reply to mallard

    mallard:


    Nice how he's used powers of 2 for all the possibilities...

    Would C# allow something to be (Opened | Removed) for instance?

    It's called Flag Enum for use with bit-wise operators.  It's a very good practice.  The names like Reject, Rejected, Deleted, Removed, UnRejected = 1024 are the WTF.

    I am a rejected reject that was deleted removed, and unrejected... oh yeah, and I was approved. [:^)]

  • Pyromancer (unregistered) in reply to Jon

    Anonymous:
    What I love is that you could have an OrderStatus value of 1152, which would be both Rejected and UnRejected....

    it's things like this that make software maintenance fun

  • Isvara (unregistered) in reply to Colin
    Anonymous:
    Tri-bool: true, false, null.

    What's the problem with that?

    If you were to mark the gender of someone named "Rene" or "Chris", what would you mark it as?  Perfect instance of a boolean situation (male or female, obviously) and a third: unkown/not-sure.

    Hardly a WTF on that count.


    Indeed. And, in fact, the C++ Boost library specifically provides a tribool type. Of course, its semantics are well-defined. Perhaps this is less so here.

  • Alex (unregistered) in reply to Colin

    Anonymous:

    Three-state logic is common in logic simulation: a binary signal can either be true, false, or unknown ('x'), and that's perfectly reasonable because we can reason about thebehaviour of a circuit in the presence of unknown values ( 1 | x  is equal to 1, for instance). Of course, things get even more amusing when you add in the fourth logic state, 'z'...

    As for circuit simulation, HIGH (1), LOW(0), UNKNOWN(X), RISING(U), FALLING(D) would have 5 states already - and that's what we use to build up our good old boolean systems in reality [<:o)]

  • Just Another WTF (unregistered) in reply to Integration Nation
    Anonymous:

    Gender is not the appropriate situation to apply boolean logic.  Chromosomally speaking, you can be boolean (presense or abscense) minded when talking about whether a Y chromosome on the sex gene exists, but in terms of physical appearance and culture, you could be dealing with an indivudual who is intersex could be classified as (Gender.MALE | Gender.FEMALE), depending on how the individual feels that day and where in his/her life (s)he is in before (optional) gender-correction surgery.

    The moral of the store is, use an enum here and put the options you need.  I would disagree with using NULL instead of an Other/Intersex value, as if you removed the person's undergarments there definately isn't NULL going on down there.  This situation occurs naturally in the population at large.

    Hope that cleared things up.

    Not to mention odd ball cases like XXY and other naturally occuring genetic situations.

  • (cs) in reply to jvb

    Anonymous:
    Enumerating 3 states was probably in response to dealing with the database backend.

    The order status is definitely a set of flags.  There's no reason not to have conflicting flags if precedence is handled in code or if an exception is raised when an invalid flag combination is set.  

    Where's the wtf?

     

    I've seen this comment (or renditions of it several times) and my problem with this assumption is that if you state a column in SQL (or any other db, i hope) as a Boolean you would want two states, the definition of boolean.  Therefore it would be true or false, and you would add NOT NULL to the column definition.  Therefore for gender if you desired to have two columns of bool for male and female, the unknow state would be both false, if both are true well...

    I'm guessing that if it's a db backend problem the definition of the columns is incorrect.

     

    remember...

  • Aredridel (unregistered) in reply to Colin
    Anonymous:
    Tri-bool: true, false, null.

    What's the problem with that?

    If you were to mark the gender of someone named "Rene" or "Chris", what would you mark it as?  Perfect instance of a boolean situation (male or female, obviously) and a third: unkown/not-sure.

    Hardly a WTF on that count.


    Male, female, intersexed, transsexual, unknown, not sure....
  • (cs)
    public enum BOOL
    {
      TRUE,
      FALSE,
      NOT_TRUE_OR_FALSE
    }


    Why stop there?

    public enum BOOL-BALL
    {
    TRUE,
    FALSE,
    MOST_LIKELY,
    MY_SOURCES_SAY_FALSE,
    SIGNS_POINT_TO_TRUE,
    TRUE_DEFINITELY,
    OUTLOOK_TRUE,
    OUTLOOK_NOT_SO_TRUE,
    REPLY_HAZY_TRY_AGAIN
    }
  • Anita Tinkle (unregistered) in reply to pmagill

    Anonymous:
    DisturbedSaint:
    Grovesy:
    True, to my knowledge is not a Gender.


    I really want to say something about how true would obviously be male, and false would be female...but I'm afraid some of you might think I'm being sexist.  So I won't say anything at all.

    -ds


    I guess this has to do with teh appearance of the 1 and 0.  One of them is obviously more of a phalic symbole then the other.  Of course this could be the root cuase of many fallicies.

     

    More like the root cause of many phalluses

  • (cs) in reply to pmagill
    Anonymous:
    I guess this has to do with teh appearance of the 1 and 0.  One of them is obviously more of a phalic symbole then the other.


    I read this and now I can't touch power buttons anymore.
  • Derek (unregistered) in reply to John Smallberries
    John Smallberries:
    Anonymous:
    P.S.  You know, this forum software is pretty much entirely nonfunctional with Firefox.  <insert comment="" about="" the="" real="" wtf=""></insert>

    I'm using FF 1.5.0.1 and it works like a champ. When I was on 1.0 it also worked nicely.


    Ahh, looks like my prior input sequence just pissed off the interface.  Try hitting the reply button, then (without entering any text), hit the "HTML" tab.  Then click back to the "design" tab.  Now type something.  Now try your arrow keys. . .   Or try to post what you typed .
  • (cs)

    I'm surprised that a number of posters are defending this bit of code. There are two possible ways that this enum will be used:

    1. Bitmask. Status = 132 means Approved and Rejected. Um, yeah. Status = 32 means PaidFor but not Opened or Approved. Er.... These don't seem like sensible states for a bitmask.

    2. Single state. Status = 4 means Approved and Status = 128 means rejected. Okay, but why didn't you just use 1, 2, 3 instead of powers of 2 for the values? And if Status has a single state, then what does UnRejected mean? Don't we need to be able to say that an order is UnRejected and Approved, or UnRejected and PaidFor?

    This is the very definition of a WTF. I look at the enum and say "WTF is it supposed to do?".

    AlpineR

  • Loren Pechtel (unregistered) in reply to Maurits
    Maurits:
    Anonymous:
    If you were to mark the gender of someone named "Rene" or "Chris", what would you mark it as?


    I believe "Rene" is a male name... the female version is "Renee" (give or take an accent mark or two)

    Compare fiance and fiancee.


    Figuring out gender can be quite a puzzle.

    I'm *VERY* used to being thought female--the male version of my name is so uncommon that people think it's a variant spelling on the female version.
  • Brian (unregistered) in reply to AndyW

    Anonymous:
    I'm new to reading the daily wtf ( great site by the way ).. Do you guys see this alot, people rewriting or replacing fundamental pieces of a language?

    I believe this would be absolutely NOT_TRUE_OR_FALSE.

  • (cs) in reply to Ribbly Screwspigot
    Anonymous:

    any attempt to "extend" Boolean logic to include a ternary state is also the work of a dumbass. Including nullable bools.



    Are you that sure? And what do you put in your database when you don't know the state of a field, or the field just doesn't apply? Want an example? A list of software where each entry has a "working" field, meaning "does this program work?" Obviously, a program can either be working or not... but what if you haven't tested it yet?

    But you appealed to a higher authority. Let me appeal to several others: the creators of all those SQL databases out there. According to you, they're all dumbasses, right? And you must be Edgar Codd himself? Oh wait, you can't be. Codd's 3rd rule explicitly says "The DBMS must allow each field to remain null (or empty). [...]" (see on Wikipedia).

    <personal:rant>I have a biiig problem with people who argue an issue though they haven't read one bit about it, or at least talked to someone familiar with the matter. Naturally, when invited to do so, they usually refuse. I guess changing opinions is exceedingly difficult to some people. Living in one's own fantasy world and all that...</personal:rant>
  • NewbieCoder (unregistered) in reply to Derek

    Everyone talking about the [Flags] Attribute got me looking it up, because I've done bitwise enums before without it... I assume everyone is talking about the [FlagsAttribute] Attribute :)  And while it does look nice, there's nothing stopping one from using a straight enum.  It just requires you explictly casting to an int and then back to the enum type, ie:

    if(Convert.ToBoolean((this.Order.CurrentOrderStatus & (int)OrdersProg.OrderStatus.Open)){ /do something/ }



  • (cs) in reply to Derek
    Anonymous:
    John Smallberries:
    Anonymous:
    P.S.  You know, this forum software is pretty much entirely nonfunctional with Firefox.<insert comment="" about="" the="" real="" wtf=""></insert>


    I'm using FF 1.5.0.1 and it works like a champ. When I was on 1.0 it also worked nicely.


    Ahh, looks like my prior input sequence just pissed off the interface.  Try hitting the reply button, then (without entering any text), hit the "HTML" tab.  Then click back to the "design" tab.  Now type something.  Now try your arrow keys. . .   Or try to post what you typed .


    So you have found a bug.  It is hardly "You know, this forum software is pretty much entirely nonfunctional with Firefox."  That is a typical end user behaviour and not a good one.  "Physician, heal thyself."

    Sincerely,

    Gene Wirchenko

  • Anita Tinkle (unregistered) in reply to Holmok
    Anonymous:

    mallard:


    Nice how he's used powers of 2 for all the possibilities...

    Would C# allow something to be (Opened | Removed) for instance?

    It's called Flag Enum for use with bit-wise operators.  It's a very good practice.  The names like Reject, Rejected, Deleted, Removed, UnRejected = 1024 are the WTF.

    I am a rejected reject that was deleted removed, and unrejected... oh yeah, and I was approved. [:^)]

    Like booleans, enums can be abused, too.

    Status, the one-word summarization of the state of an object, is a tricky area.  It's often (over)used in the indication of an object within some sort of defined lifecycle, but the process within the lifecycle grows like an amoeba.

    Thus, you create a problem where the users start to create many statuses in order to dileneate and seperate workload, when you really should have created a container structure (like seperating queues) to represent the workflow state or used some external business rules engine (or roll your own) to handle the changes.

    Say you have a new system for handling incoming medical claims.  You start off handling incoming claims with these statuses:

    New
    In-Adjudication
    Discarded
    Approved
    Pending Payment
    Paid
    Denied

    Simple, right?  For 100 claims a day probably so.  But, like email, it's going to be organized differently when the volume goes up and probably some automatic distribution code will be added to help seperate the workload.  If you come back to the system in a year you'll probably see some statuses like these:

    New - Unassigned
    New - Region A
    New - Region B
    New - Region C
    New - Large Claims
    Discarded
    Hold
    In-Adjudication
    Adjudication Pending (Fraud Review)
    Adj. Pending (Audit)
    QC - Wait
    QC
    Approved To Pay
    Approved To Split
    Pending Payment - Cincinatti
    Pending Payment - Direct Pay
    Paid
    Denied Full
    Denied Partial
    Denied - Appeal Filed
    Reopen

    Within 3 years you'll see a bunch of dead statuses and all sorts of non-descript meanings attatched to others.  When it comes to a status that indicates the state of something within a WORKFLOW, then the best idea is to wrap the object in a container which you can change (like mail within a folder or a file within a directory).

    Like mail, mail objects can be reorganized if you have folders to organize them in.   You can also create rules in code or with external vendor app help to automate the process of moving the objects around within the containers.

    Healthcare claims typically have at least 10 different "statuses".  The healthcare provider (your hospital) might have different statuses for how complete the claim is, and where in the electronic filing process the claim is in, where in the payment cycle process the claim is, and if the claim was denied, where in the legal process the claim is in.   A payer (your HMO) keeps track of where in pre-adjudication the claim is in, where in the remittance process the claim is in, where in the appeals process the claim is in, and so on.

    Enums are a quick-n-dirty, but if you change the process a lot, you will be living with a data-shuffling nightmare as the workflow changes.

  • Truls (unregistered) in reply to Smaerd

    Actually... a qubit would be measured as true, false, or both. Not true, false, or neither. So I don't know what this could be.

  • chuck (unregistered) in reply to Colin

    Agreed, it's not unheard-of to have tri-state logic "true / false / unknown" as a lot of people point out... but "unknown" is a far cry conceptually from being "neither true or false"!  Or as my co-worker interpreted it, (! TRUE) || FALSE, which would be basically equivalent to false.  Just weird is all.  I don't see the usefulness.

  • merrywing (unregistered)

    It seems that the OrderStatus flags mark some kind of workflow milestones. The order would progress through different stages, setting just one bit at every stage. Then, when you want to select or count orders in a given state, you just search for (Orders.Status & PaidFor.!= 0).

    Of course, the WTF is that this is the poor man's relational model, when they should have created a separate table for tracking an order's progress through the system.

    As for the BOOL construct, the modern C# 2.0 has just the equivalent: the 'bool?' type, which holds values of true, false and null (just like a field in a database). The NOT_TRUE_OR_FALSE usually means 'we don't know', 'not applicable', or 'who gives a sh*t'.

  • Loren Pechtel (unregistered) in reply to ChiefCrazyTalk
    Anonymous:

    Normally I shake my head in disbelief at the WTFs posted on this site, but this isn't one of them.  For example, I could envision a separate order status for reject (order is slated to be rejected), rejected (order has already been rejected) and unrejected (was rejected once, but was overridden and restored).  And as others have mentioned,  the fact that databases allow nulls means True/False/Unknown (or whatever you would like to call the third state) actually makes sense.

    I would say that "reject" is a recommendation, not an absolute.

    While I haven't seen the business logic I don't see anything inherently wrong with the bitmap.

    The tri-state boolean, though!  I have no problem with such tri-states and have even implemented a few over the years.  Pick better names, though!  I summed it up pretty well in some long-ago documentation:  The computer won't care if the key for a wall cabinet is "BASE" but the users sure will!

Leave a comment on “Enumerating The Difficulties”

Log In or post as a guest

Replying to comment #:

« Return to Article