• (cs) in reply to ANSI C
    ANSI C:
    I would argue that inclusion via standard library headers would qualify as being "in the language." If not, C becomes a rather useless language that doesn't even have the ability to print output to the console.

    IMHO, printing output to the console should not be considered a feature of the "language", but instead, a responsibility of the "operating system". After all, assembly doesn't have any way to print to a console either... it's done through an interrupt to the OS.

    A language isn't portable if it relies on the assumption that it is running on a particular type of machine, whether that is a PC or a remote control car (which shouldn't have a console for output, by the way). That's where the beauty of C comes from - it's portable assembly.

    My point was more that I would view any functionality granted by standard libraries of a language as features of the language as a whole.

  • Ouch! (unregistered) in reply to clownzor
    clownzor:
    Ouch!:
    clownzor:
    Ad hominem != insult. If he had said "Your argument is wrong because you are a dumbass", that would be an ad hominem. However, he clearly listed the reasons he thought you were wrong. That is not an ad hominem, idiot.
    He wrote "ad hominem attack", which calling someone a dumbass clearly is. He didn't accuse whomever of a logical fallacy but of bad behaviour.

    Logic would like to have a word with you: http://en.wikipedia.org/wiki/Ad_hominem#Common_misconceptions

    Whoa, mate, I've got news for you. One can use Latin phrases in different contexts. Not every time the phrase "ad hominem" appears it is about logic.

    ad hominem argument != ad hominem attack
    
  • anon (unregistered) in reply to Allister
    Allister:
    Rottweiler:
    Kevin:
    AS/400s are actually kind of nice. They are pretty stable, we have a custom POS written in RPG.

    I was once moved into a position where I had to work with an AS/400 - nothing newer than RPG3 - 6 character variables max, all caps, "Databases" were files, and use of the newfangled SQL was forbidden. Green Screen was holy, and I hightailed it out of there faster than you could mouth WTF!

    Nothing wrong with green screen. Still faster than many modern systems. As for RPG3, if you can't write a program that uses the cycle you can't call yourself a real RPG programmer. ;-)

    thank god for that

  • Cory A. (unregistered) in reply to da Doctah

    Exactly. Its not so ancient that it isn't usable. Quite usable and efficient actually. I think alot of people would be very surprised to realize just how much of their lives finds its way through COBOL code every day.

  • K (unregistered) in reply to saepius
    saepius:
    TRWTF is not upgrading your system from an old, dead language. The stupid blokes around here are still using Java, for some arcane reason.

    I'm a bloody Englishman! Java is amazing.

  • (cs) in reply to Allister
    Allister:
    Rottweiler:
    Kevin:
    AS/400s are actually kind of nice. They are pretty stable, we have a custom POS written in RPG.

    I was once moved into a position where I had to work with an AS/400 - nothing newer than RPG3 - 6 character variables max, all caps, "Databases" were files, and use of the newfangled SQL was forbidden. Green Screen was holy, and I hightailed it out of there faster than you could mouth WTF!

    Nothing wrong with green screen. Still faster than many modern systems. As for RPG3, if you can't write a program that uses the cycle you can't call yourself a real RPG programmer. ;-)
    It's not all about speed. The GUI entered mainstream use twenty years ago, and a lot of human-computer interaction research has been done since then. None of the fruits of this research can be implemented on a green screen. It's still OK for a data-entry person, but a knowledge worker is severely hamstrung by a green screen.

  • (cs) in reply to slavik262
    slavik262:
    hoodaticus:
    jpers36:
    Someone Who Couldn't be Bothered to Log On from Work:

    In C, there is no boolean data type. That's why everyone uses int.

    Please try again. You are only wrong by 11 years. Granted, Windows and *nix, being over 11 years old, don't use it, but it still exists.

    So you're arguing that he's wrong by citing a standard that is widely ignored and admitting it? Interesting tactic.

  • (cs) in reply to slavik262
    slavik262:
    trwtf:
    slavik262:
    hoodaticus:
    jpers36:
    Someone Who Couldn't be Bothered to Log On from Work:

    In C, there is no boolean data type. That's why everyone uses int.

    Please try again. You are only wrong by 11 years. Granted, Windows and *nix, being over 11 years old, don't use it, but it still exists.

    Sorry, slavik, but he's still right. To quote from your preferred source...

    I would argue that inclusion via standard library headers would qualify as being "in the language." If not, C becomes a rather useless language that doesn't even have the ability to print output to the console.

    Shame on Hoodaticus for not using the word primitive, even though most (non-pendants) would be able to infer that's what he meant. Sheesh.

  • (cs) in reply to Bobbo
    Bobbo:
    I once worked with an in-house language which didn't have the ability to represent decimal points. So all such numbers were multiplied up by 100 or 10000 to retain the .00 or .0000 precision, then passed around/stored as needed, then divided back down for display.

    Genius.

    It's better than Binary Coded Decimals, which I still have to work with, occasionally.

  • (cs) in reply to Anonymous
    Anonymous:
    I've never understood why people think Lady Gaga is a man. She's clearly just a horrifically ugly woman or, very possibly, a bridge troll.

    I think your right! Why just the other day, I'm pretty sure she logged on to bridgeonline.org and started a thread about how spades was a far superior card game. It caused quite a ruckus.

  • (cs) in reply to Anonymous
    Anonymous:
    jpers36:
    Someone Who Couldn't be Bothered to Log On from Work:
    dumbass
    Sorry, I refuse to continue any discussion after an ad hominem attack.
    I really don't want to wade into this nonsense but for the sake of my own sanity (and to prevent you looking like an idiot in future arguments) I have to point out that this is not an ad hominem attack. This is just good old-fashioned name calling and you truly make yourself sound stupid by breathlessly blurting out "ad hominem!" just because someone insulted you. No disrespect or anything but this is a pet hate of mine; http://en.wikipedia.org/wiki/Ad_hominem#Common_misconceptions In this internet age it would only take you thirty seconds to look up the definition so I really don't see you have any reason to get it wrong. Here, I'll even save you some time: http://en.wikipedia.org/wiki/Ad_hominem. Good luck in future arguments and be sure to use your new-found knowlege wisely!
    So, to summarise:
    ...you truly make yourself sound stupid...
    Basically, you're calling him a dumbass. :)
  • trwtf (unregistered) in reply to Jaime
    Jaime:
    Allister:
    Rottweiler:
    Kevin:
    AS/400s are actually kind of nice. They are pretty stable, we have a custom POS written in RPG.

    I was once moved into a position where I had to work with an AS/400 - nothing newer than RPG3 - 6 character variables max, all caps, "Databases" were files, and use of the newfangled SQL was forbidden. Green Screen was holy, and I hightailed it out of there faster than you could mouth WTF!

    Nothing wrong with green screen. Still faster than many modern systems. As for RPG3, if you can't write a program that uses the cycle you can't call yourself a real RPG programmer. ;-)
    It's not all about speed. The GUI entered mainstream use twenty years ago, and a lot of human-computer interaction research has been done since then. None of the fruits of this research can be implemented on a green screen. It's still OK for a data-entry person, but a knowledge worker is severely hamstrung by a green screen.

    "knowledge worker"? Getouttaheah! This is a site for geeks, not management types.

  • rew (unregistered) in reply to Bobbo

    Which is a good idea, because it leads to nice and predictable results.

  • rew (unregistered) in reply to rew
    rew:
    Which is a good idea, because it leads to nice and predictable results.
    Which was in reference to the: "... in house.... language ... no decimal point ... divide 100 or 10000 .... "
  • (cs) in reply to clownzor
    clownzor:
    Ouch!:
    He wrote "ad hominem attack", which calling someone a dumbass clearly is. He didn't accuse whomever of a logical fallacy but of bad behaviour.

    Logic would like to have a word with you: http://en.wikipedia.org/wiki/Ad_hominem#Common_misconceptions

    So you're saying that it's logic when you post a link to a wiki? Interesting...

    Behold!

    Your link discusses the argument fallacy. Mine discusses the words themselves. So my logic wins.

  • trwtf (unregistered) in reply to boog
    boog:
    Your link discusses the argument fallacy. Mine discusses the words themselves. So my logic wins.

    Do I need to remind you about winning arguments on the internet?

  • An Old Hacker (unregistered) in reply to Bobbo
    Bobbo:
    I once worked with an in-house language which didn't have the ability to represent decimal points. So all such numbers were multiplied up by 100 or 10000 to retain the .00 or .0000 precision, then passed around/stored as needed, then divided back down for display.

    Genius.

    Child, until you've stared deeply into the horror that is binary-to-decimal conversion, you have no understanding about what is going on. Depending on the sensitivity of the environment, this might well have been a language feature designed to keep OMG!ITEOFTW! wtfs from happening due to cowboys who think that 0.2 * 5 == 1. That's entirely besides the fact that you can get faster processing on cheaper hardware if you don't have floating point.

    Is that what was going on there? I don't know. But your failure to indicate that it was not suggests that you don't know the importance of the fact.

  • ratis (unregistered) in reply to nobody
    nobody:
    jugis:
    Bruce:
    null:
    CICS is the same age as Unix.
    Yes, but wine improves with age, and milk doesn't.
    Wine turns to vinegar.
    Nope. Age does not convert wine to vinegar. Exposure to oxygen does. Have you never considered the fact that the best wines are aged by many years?
    So are the best cheeses, and cheese comes from milk.
  • abigo (unregistered) in reply to nobody
    nobody:
    jugis:
    Bruce:
    null:
    CICS is the same age as Unix.
    Yes, but wine improves with age, and milk doesn't.
    Wine turns to vinegar.
    Nope. Age does not convert wine to vinegar. Exposure to oxygen does. Have you never considered the fact that the best wines are aged by many years?
    So, your point is that old code is best when it is sealed away and never used?
  • amet (unregistered) in reply to Jeremy Friesner
    Jeremy Friesner:
    Gavin:
    Reminds me of the gender codes the NZ Ministry of Health uses (which actually comes from Statistics New Zealand)

    M = Male F = Female U = Unknown I = Indeterminate

    Well that's clearly not right. The proper way to represent gender is via normalized floating point (where 0.0f == wholly female, 1.0f == wholly male, 0.5f == perfectly hermaphrodite, and so on). "Unknown" (and/or Lady Gaga) is represented by NaN.

    NaN. Not a Neuter?????

  • Battleship Grey? (unregistered) in reply to Jaime
    Jaime:
    Allister:
    Rottweiler:
    Kevin:
    AS/400s are actually kind of nice. They are pretty stable, we have a custom POS written in RPG.

    I was once moved into a position where I had to work with an AS/400 - nothing newer than RPG3 - 6 character variables max, all caps, "Databases" were files, and use of the newfangled SQL was forbidden. Green Screen was holy, and I hightailed it out of there faster than you could mouth WTF!

    Nothing wrong with green screen. Still faster than many modern systems. As for RPG3, if you can't write a program that uses the cycle you can't call yourself a real RPG programmer. ;-)
    It's not all about speed. The GUI entered mainstream use twenty years ago, and a lot of human-computer interaction research has been done since then. None of the fruits of this research can be implemented on a green screen. It's still OK for a data-entry person, but a knowledge worker is severely hamstrung by a green screen.
    As a Windows user I'm pretty hamstrung by all that battleship grey. Mind you, I'm pretty sure I remember reading a paper a few years ago that assessed the "best" screen colours based on a number of criteria such as readability, minimising eye strain and so forth. The winner? Battleship grey. I can't remember if it was authored by Microsoft, wouldn't surprise me.

  • trwtf (unregistered) in reply to abigo
    abigo:
    nobody:
    jugis:
    Bruce:
    null:
    CICS is the same age as Unix.
    Yes, but wine improves with age, and milk doesn't.
    Wine turns to vinegar.
    Nope. Age does not convert wine to vinegar. Exposure to oxygen does. Have you never considered the fact that the best wines are aged by many years?
    So, your point is that old code is best when it is sealed away and never used?

    No, silly. His point is that old code is best enjoyed with a well chosen spoiled milk and some simple water crackers or a good loaf of bread, and good conversation.

  • JonP (unregistered)

    Could have been worse, like T/T ('tis false/'tisnt false).

  • Anonymously Yours (unregistered)

    No no no, this is not refunctered enough. It should be-

    VALUES FOR INVALID-BATCH-OPERAND, PIC X(1) --> "F" - represents False --> "N" - represents Not False --> "JK" - suffixed "not" operator; reverses the value. Do not use with "N" as double negatives are still frowned upon.

  • Luiz Felipe (unregistered)

    Its a simple problem to be solved using physics. you only need an external iteraction in your system to decay state (think of schrodinger cat). your boolean N is true and false in same time, it needs an observer to decay.

    Perhaps some EMP device that activate aleatory near the "mainframe".

    Or something like this in cobol (if possible, i dont know cobol) #define true (rand()%2)

  • bd (unregistered) in reply to trwtf
    trwtf:
    Jaime:
    None of the fruits of this research can be implemented on a green screen. It's still OK for a data-entry person, but a knowledge worker is severely hamstrung by a green screen.

    "knowledge worker"? Getouttaheah! This is a site for geeks, not management types.

    s/knowledge worker/facebook surfer

  • Jay (unregistered) in reply to null
    null:
    CICS is the same age as Unix.

    Some technologies, like some people, age better than others.

  • Jim (unregistered) in reply to Correcterer

    Correction - For a time you could get CICS on an AS/400. But, not VSAM.

  • (cs) in reply to andrewjb

    I worked on an AS400. T meant 'Thursday' and F meant 'Friday' except when it didn't.

  • (cs)

    It could also mean "F"ail / "N"ormal

  • bene (unregistered) in reply to Pyrexkidd
    Pyrexkidd:
    hoodaticus:
    jpers36:
    Someone Who Couldn't be Bothered to Log On from Work:
    I don't see the problem here. Are you aware that a boolean takes just as much space as a character? Having boolean datatypes is stupid, especially when the need for a "maybe" comes up and you have to go retrofit your code. Now, having boolean logic is another story.

    TRWTF in the article is that so many different string representations were used to represent boolean values.

    TRWTFs in your comment are (1) boolean datatypes don't HAVE to take as much space as a character -- see c, for example; (2) even in those languages in which a boolean datatype does take up a full byte, boolean comparisons will take up less time than character comparisons; and (3) failing even THAT, using strings to represent boolean values leads you right into the article's TRWTF.

    Of course, TRWTF with my comment is that odds are you're a troll.

    In C, there is no boolean data type. That's why everyone uses int.

    In perl there are no boolean data types. You can however, TEST for boolean values. All values other than "" or "0" are true (strings, int, float, etc (although perl doesn't have these data types either)).
    Conversely the only false values are "" or "0".

    so in perl "N", "Y", "FnF", "1", "ReallyFalse", "ExtraFalse", "Maybe" all test true.

    Any way, that's my $.02.

    My favourites are 0 but true values like 0E0.

  • Spudd86 (unregistered) in reply to wtf

    What you use to reason about spaghetti code, or alternatively the logic that lead to such code.

  • (cs) in reply to fritolay
    fritolay:
    I worked on an AS400. T meant 'Thursday' and F meant 'Friday' except when it didn't.

    "H" means tHursday. "T" means Tuesday. No wonder your program doesn't work. ;)

  • (cs) in reply to saepius
    saepius:
    The set of True values (T, Y, 1, N) The set of False values (F, N, 0) The intersection of True and False values (N)

    So far, none of the suggested solutions will handle the value N being used vor both True and False.

    Well, based on my experience with a certain horrid program I am having to tackle, it can be done by using alternate values for 'N'. So, for example...

    To make it true:

         MOVE 'N' TO INVALID-BATCH-OPERAND
          (snip a few lines)
         IF INVALID-BATCH-OPERAND = 'N'
            MOVE '>'     TO INVALID-BATCH-OPERAND.
    

    To make it false:

         MOVE 'N' TO INVALID-BATCH-OPERAND
    

    Later on (and in as many places as possible):

         IF INVALID-BATCH-OPERAND = 'N'
            MOVE '*'     TO INVALID-BATCH-OPERAND.
         IF INVALID-BATCH-OPERAND = '>'
            MOVE 'N'     TO INVALID-BATCH-OPERAND.
         IF INVALID-BATCH-OPERAND = 'F' OR 'T' OR '1' OR 'N'
            DO SOMETHING
         ELSE
            DO ANOTHER THING.
         IF INVALID-BATCH-OPERAND = 'N'
            MOVE '>'     TO INVALID-BATCH-OPERAND.
         IF INVALID-BATCH-OPERAND = '*'
            MOVE 'N'     TO INVALID-BATCH-OPERAND.
         IF INVALID-BATCH-OPERAND = 'F' OR 'N' OR '0'
            DO SOMETHING
         ELSE
            DO ANOTHER THING.
    

    Yes, you would go insane (I certainly did).

  • Josh (unregistered) in reply to andrewjb
    andrewjb:
    How about:

    --> "F" - represents Fortunately True --> "T" - represents Terribly False.

    I once used an Analog Devices sensor that measured rotation and temperature. What do you think the labels on the board, "R" and "T" stood for?

    "Relative temperature" and "twist," apparently.

  • George (unregistered) in reply to Leo
    Leo:
    ABAP (based on Cobol) still suffers from char-bool variables today, which are usually treated as if they were "checkboxes", i.e., "X" = true and " " = false.

    Even better, there is a boolean type in ABAP that has three different values: "X" for True, "-" for False and " " for Unknown. Still in use.

  • (cs)

    Sigh.

    Not everyone uses ints for bool, and they're never used for bools simply because C does not have a bool. Char is frequently used for bool because C doesn't have a bool. But then the programmer confuses the situation, by assigning numbers to the char variable...

    Ints are used for bools because ints are defined to be the fastest integer type that's at least 16 bits. Because of this, you're guaranteed that the compiler isn't going to be loading a word and splitting it, behind the scenes, to get you your variable. It just loads it, and you're done. So ints are fast, and sometimes, especially on newer systems, byte-sized chars are not as fast.


    Different processors are different. Some can compare against a particular bit in the same time it takes to compare the whole word - so bitpacked boolean comparisons are just as fast as int comparisons. Some can set the true/false flag simply by loading the variable, so you can skip the comparison if you're using a native integer type. Some processors have different speeds for different types of comparison operators. Some systems can load just 4 bits (nybble), some can only load a word at a time, some can load a byte but not a nybble.


    If I explain all of the reasons why you are wrong, and then insult you, it's not ad hominem. If I insult you, then explain all the reasons why you're wrong, it's still not ad hominem, but it doesn't matter, because you won't read any of the explanation.

    Ad hominem is simply saying that you're obviously wrong, because you're a dumbass. That's totally not the case here, because none of you are real dumbasses. Instead, what we have here is people who have communication difficulties, and are calling each other dumbasses out of frustration.

    A real dumbass would do something truly stupid, like trying to make an intelligent post long after everyone else has finished commenting on the story, so nobody'd see it.

  • Max E. (unregistered)

    I think I just burst a vein in my cornea.

Leave a comment on “Boolean Truths”

Log In or post as a guest

Replying to comment #:

« Return to Article