The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Quarternary Boolean

Last post 07-31-2010 6:29 AM by The_Assimilator. 19 replies.
Page 1 of 1 (20 items)
Sort Posts: Previous Next
  • 07-25-2010 5:30 AM

    • Renan
    • Top 75 Contributor
    • Joined on 08-10-2007
    • Fortaleza, Brazil
    • Posts 731

    Quarternary Boolean

    This is from a job I've quit many, many years ago.

    public enum OurBoolean

    {

        True,
        False,
        Unknown,
        Null

    }

    If I had had access to George Boole's coffin back then, I could have used it to generate electricity from his spinning corpse.

    It was actually named a bit differently. I've replaced the company name with "Our".

    So I asked the father of this hideous child why in the Malebolge did he code it like that. His answer was "dude, it's logic!"

    You see, in propositional logic there are those propositions which are always true (tautologies), those that are always false (contradictions), and those that may either be true or false (contingencies). The "Unknown" value in the enumeration was written so as to represent a contingency. Nevermind that everywhere in the application, this enumeration was used instead of your regular, day-to-day boolean variables. There was also a considerable amount of code to convert from the enumeration to normal booleans. The part dealing with "Unknown" was full of //TODO comments.

    As for the null value, that was put there so as "to comply with the DBMS". Which is why they made me look at this thing in the first place, they were having troubles with null values when they came from a database. I tried my best at explaining to them why a null reference and OurBoolean.Null were not the same thing. But the dev behind the monstruosity kept saying "but it's written 'null' in there, so it has to be null".

    snoofle

    That hideousness is what keeps you and I [sic] employed!
  • 07-25-2010 7:54 AM In reply to

    • Paddles
    • Not Ranked
    • Joined on 11-11-2007
    • Australia
    • Posts 87

    Re: Quarternary Boolean

    Renan "C#" Sousa:
    But the dev behind the monstruosity kept saying "but it's written 'null' in there, so it has to be null".

    That's an easy one to solve. Ask him to lend you the biggest note in his wallet, promising to pay him back double within a hour. Suppose he gives you a $100 note (am I correct in understanding that the $ symbol is used for BRL?) - then get two pieces of paper, write "$100" on each one, and give them back as payment. Each says $100 just like the one he gave you, so they must be the same.

    Or, even better, give him $200 in Zimbabewan dollars.


  • 07-25-2010 8:47 AM In reply to

    Re: Quarternary Boolean

     

    Renan "C#" Sousa:
    spinning

    You win for a Dresden Codak reference.


    In complex analysis, a meromorphic function on an open subset D of the complex plane is a function that is holomorphic on all D except a set of isolated points

  • 07-25-2010 11:30 AM In reply to

    • LTs
    • Not Ranked
    • Joined on 07-26-2005
    • Sweden
    • Posts 1

    Re: Quarternary Boolean

    Unfortunately, this kind of thing seems to be rather common, I've encountered ternary booleans on numerous occasions (even as front page material, back in the days: http://thedailywtf.com/Articles/True,_False,_or_Yellow.aspx and http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx). I can see the reasoning behind an "unknown" value, but the author of this seems to be pushing his luck with logic. (Makes me feel kind of good about ditching computer science for a degree in mathematics...)
  • 07-25-2010 3:05 PM In reply to

    Re: Quarternary Boolean

    Renan "C#" Sousa:

    public enum OurBoolean

    {

        True,
        False,
        Unknown,
        Null

    }

    It was actually named a bit differently. I've replaced the company name with "Our".

     

    So it's not only a Quaternary Boolean as described in the thread title, it's a Proprietary Quaternary Boolean!  No sirree, we can't have $competing_company thinking they can use Our enum values on Their own booleans!

  • 07-25-2010 4:35 PM In reply to

    Re: Quarternary Boolean

    Renan "C#" Sousa:
    public enum OurBoolean

    {

        True,
        False,
        Unknown,
        Null

    }

     

    What about "File not Found" or "Printer is on fire".

     

  • 07-25-2010 4:45 PM In reply to

    Re: Quarternary Boolean

    So where's the code that lets you multiply it with a vector to twist the truth?

    Begging the question since 2007.
  • 07-26-2010 3:24 AM In reply to

    • Nelle
    • Top 150 Contributor
    • Joined on 11-08-2007
    • graz.at.earth.milkyway.universe
    • Posts 407

    Re: Quarternary Boolean

    dhromed:

     

    Renan "C#" Sousa:
    spinning

    You win for a Dresden Codak reference.


    seconded
  • 07-26-2010 3:24 AM In reply to

    Re: Quarternary Boolean

     You know what the best part of this is?

    Console.WriteLine( (OurBoolean)0 ); //outputs True

    Console.WriteLine( (OurBoolean)1 ); //outputs False
  • 07-26-2010 4:04 AM In reply to

    Re: Quarternary Boolean

    Nelle:
    dhromed:

     

    Renan "C#" Sousa:
    spinning

    You win for a Dresden Codak reference.


    seconded
     

     Bayesian Empirimancer is 85% confident.


    In complex analysis, a meromorphic function on an open subset D of the complex plane is a function that is holomorphic on all D except a set of isolated points

  • 07-26-2010 8:17 AM In reply to

    • Renan
    • Top 75 Contributor
    • Joined on 08-10-2007
    • Fortaleza, Brazil
    • Posts 731

    Re: Quarternary Boolean

    Paddles:
    am I correct in understanding that the $ symbol is used for BRL?

    Yes. Either $ or R$.

    dhromed:

    Nelle:
    dhromed:

     

    Renan "C#" Sousa:
    spinning

    You win for a Dresden Codak reference.


    seconded
     

     Bayesian Empirimancer is 85% confident.

    My a priori knowledge told me that.
    snoofle

    That hideousness is what keeps you and I [sic] employed!
  • 07-26-2010 8:24 AM In reply to

    • GreyWolf
    • Not Ranked
    • Joined on 12-03-2007
    • Where the Raspberry Pis grow
    • Posts 76

    Re: Quarternary Boolean

    da Doctah:

    So it's not only a Quaternary Boolean as described in the thread title, it's a Proprietary Quaternary Boolean!  No sirree, we can't have $competing_company thinking they can use Our enum values on Their own booleans! 

     

    Post of the Thread

    Yea verily quothing Boomzilla, "The demand for programming is greater than the actual supply of people who actually know what they're doing. "
  • 07-26-2010 4:21 PM In reply to

    • Nelle
    • Top 150 Contributor
    • Joined on 11-08-2007
    • graz.at.earth.milkyway.universe
    • Posts 407

    Re: Quarternary Boolean

    Renan "C#" Sousa:
    Filed under: I use Cartesian Dualism to separate my mind from my body and deal mindless damage.

    But they are imune to causality! You'll have to roll +20 for resistance to Euro-centrism.

    BTW: i liked the D&D one better than the AD&D 

     

     

  • 07-27-2010 3:40 AM In reply to

    Re: Quarternary Boolean

    Nelle:
    BTW: i liked the D&D one better than the AD&D 
     

    I prefer the one that's betterly drawn.


    In complex analysis, a meromorphic function on an open subset D of the complex plane is a function that is holomorphic on all D except a set of isolated points

  • 07-28-2010 1:00 PM In reply to

    • toth
    • Top 200 Contributor
    • Joined on 06-23-2009
    • Posts 328

    Re: Quarternary Boolean

    Obviously, you can't just rely on the language's logic processing. It won't follow the application's business rules, which apparently assume that the application is running in some sort of parallel universe where the normal laws of logic don't apply.
  • 07-28-2010 9:41 PM In reply to

    Re: Quarternary Boolean

    toth:
    Obviously, you can't just rely on the language's logic processing. It won't follow the application's business rules, which apparently assume that the application is running in some sort of parallel universe where the normal laws of logic don't apply.
    That must be the same universe that our project estimates come from. I'm pretty sure that the entirety of Oracle technical support is there too.
  • 07-28-2010 11:38 PM In reply to

    Re: Quarternary Boolean

    Scarlet Manuka:
    toth:
    Obviously, you can't just rely on the language's logic processing. It won't follow the application's business rules, which apparently assume that the application is running in some sort of parallel universe where the normal laws of logic don't apply.
    That must be the same universe that our project estimates come from. I'm pretty sure that the entirety of Oracle technical support is there too.
     

    I've done a few data migrations in that universe

    "These are the rules, apart from when they aren't"

    Certified Internet Engineer (CIE)

  • 07-29-2010 2:40 PM In reply to

    Re: Quarternary Boolean

    dhromed:

     

    Renan "C#" Sousa:
    spinning

    You win for an appropriate Dresden Codak reference.

    FTFY.

    <stryhf> why do people persist in continuing to write SHIT APPLICATIONS IN JAVA
    <stryhf> writing SHIT in JAVA doesn't make it ANY LESS SHITTY
    <stryhf> IT JUST MAKES IT SLOW ASS SHIT
  • 07-29-2010 4:38 PM In reply to

    Re: Quarternary Boolean

    The_Assimilator:
    dhromed:

     

    Renan "C#" Sousa:
    spinning

    You win for an appropriate Dresden Codak reference.

    FTFY.

     

    You are subtly mistaken: any Dresden Codak reference is like catching the Snitch.


    In complex analysis, a meromorphic function on an open subset D of the complex plane is a function that is holomorphic on all D except a set of isolated points

  • 07-31-2010 6:29 AM In reply to

    Re: Quarternary Boolean

    dhromed:

    The_Assimilator:
    dhromed:

     

    Renan "C#" Sousa:
    spinning

    You win for an appropriate Dresden Codak reference.

    FTFY.

     

    You are subtly mistaken: any Dresden Codak reference is like catching the Snitch.

    In that it causes morbs to hemorrhage?

    <stryhf> why do people persist in continuing to write SHIT APPLICATIONS IN JAVA
    <stryhf> writing SHIT in JAVA doesn't make it ANY LESS SHITTY
    <stryhf> IT JUST MAKES IT SLOW ASS SHIT
Page 1 of 1 (20 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems