• (cs)

    Forty-Two

  • Bob (unregistered)

    --in why.txt- /comment.asp:15 if not comment_id <> 0 then echo "WTF!"

  • (cs)

    This is not a comment... NAHT.

  • (cs) in reply to Bob
    Bob:
    --in why.txt- /comment.asp:15 if not comment_id <> 0 then echo "WTF!"

    /comment.asp:15 if not comment_id <> 0 then echo !false

  • amok (unregistered) in reply to akatherder

    /comment.asp:15 if not comment_id <> abs(0) then echo !false

  • (cs)

    I'm not not licking toads.

  • (cs)

    why not?

    or, in keeping with the double negative in the logic, why not not?

  • luctus (unregistered) in reply to A Nonny Mouse
    A Nonny Mouse:
    why not?

    or, in keeping with the double negative in the logic, why not not?

    Why (! (not not))

  • (cs)

    I could ask the same thing.

    In recently found the following (formatted as is):

    if(somevar == 'some text') {} else {
        // code
    }
  • Peter (unregistered)

    Maybe the answer was in the other 64 bytes.

  • Wyrd (unregistered)

    " /cart/checkout.asp:15 if not contact_id <> 0 then " Poignant, man. Very poignant.

    "...and crawling on the planet's face... some insects called the human race... lost in time... lost in space... and meaning..."

    -- Furry cows moo and decompress.

  • imu (unregistered)

    Neophytes. Clearly they forgot to declare constants for TRUE and FALSE.

  • AndrewB (unregistered)

    So the WTF of the day is that somebody once wrote a double negative? What about the rest of this guy's code? Is this really substantial?

  • Arild (unregistered)

    This appears to be the result of a find-in-files operation, listing the file, line-number and the line containing the text searched for (possibly "contact_id"?)

  • cthulhu (unregistered)

    not not not FileNotFound. brilliant!

    etc

    something about my captcha being relevant at a stretch even though it isn't.

    etc

    Ok think I have covered it all. No need for you to post that "witty" comment now.

  • Synchronos (unregistered)

    Aah, yes, I see it!

    The correct form would be: if isTrue(not contact_id <> 0) then

  • NeoMojo (unregistered) in reply to AndrewB
    AndrewB:
    So the WTF of the day is that somebody once wrote a double negative? What about the rest of this guy's code? Is this really substantial?
    Them someone else put that particular line of code in a text file, probably while crying and pulling their hair out, then our submitter found the file. I'd say it's a representative line.
  • Erasing History (unregistered)

    Oh, c'mon Alex, that was the funniest comment of this motley bunch!

  • (cs) in reply to Wyrd
    Wyrd:
    " /cart/checkout.asp:15 if not contact_id <> 0 then " Poignant, man. Very poignant.

    "...and crawling on the planet's face... some insects called the human race... lost in time... lost in space... and meaning..."

    Each of us -- a cell of awareness Imperfect and incomplete Genetic blends with uncertain ends On a contact_id search that's far too fleet

  • (cs) in reply to Zecc
    Zecc:
    I could ask the same thing.

    In recently found the following (formatted as is):

    if(somevar == 'some text') {} else {
        // code
    }

    Ok, that doesn't bother me as bad... I used to have a habit of things such as: public $inactive; with checks such as if(!$inactive)... which is worse than if(is_true()) { } else { ... } especially if the true condition could be filled in soon. Still not the prettiest, but could be worse

  • Erasing History (unregistered)

    I actually worked with a guy once who used and advocated the following design pattern:

    if not a=b else ...
    "for readability".

    Always wondered how his brain was wired inside, that made him think this was more "readable".

  • (cs) in reply to A Nonny Mouse
    A Nonny Mouse:
    why not?

    That looks like COBOL. Better syntax:

    !Y

  • Alan (unregistered) in reply to Wyrd

    [quote user="Wyrd"]" /cart/checkout.asp:15 if not contact_id <> 0 then " Poignant, man. Very poignant.

    "...and crawling on the planet's face... some insects called the human race... lost in time... lost in space... and meaning..."

    Or should I say Dr Von not contact_id...

  • Jim (unregistered)

    That line is an artifact of using grep an misdirecting the output into a file by mistake

  • mauhiz (unregistered)

    Why ?

  • !apoet (unregistered)

    Ours is not to question why, ours is but to code and die.

  • (cs)
    DIM true AS string
    DIM isTrue AS Boolean
    
    true = "TRUE"
    
    IF true = "TRUE" OR true = "True" OR true = "TRue" OR true = "TRUe" THEN
      isTrue = True
    ELSE
      IF true = "TrUe" OR true = "TrUE" OR true = "TruE" THEN
        isTrue = True
      ELSE
        'there could still be more instances where true can be true
        IF true = "tRue" OR true = "tRUe" OR true = "tRUE" OR true = "tRuE" THEN
          isTrue = True
        ELSE
          'I hate my life
          IF true = "trUe" OR true = "trUE" OR true = "truE" THEN
            isTrue = True
          ELSE
             'Do not need to check for the cases with upper command.
             'If the upper doesn't = TRUE then it is not true
             IF NOT upper(true) = "TRUE" THEN
               isTrue = False
             ELSE
               isTrue = true
             END IF
          END IF
        END IF
      END IF
    END IF
    
    IF NOT (isTrue = False) THEN
      DIM strComment AS String 
      strComment = "I am adding a comment.  "
      strComment = strComment + "This comment will be displayed"
      strComment = strComment + " for all the world to see.  "
      strComment = strComment + "Well, at least those with "
      strComment = strComment + "internet access and browsing "
      strComment = strComment + "to this page."
      AddComment(txtCommentBox, strComment)   
    END IF
    
    
    
    
  • (cs) in reply to !apoet
    !apoet:
    Ours is not to question why, ours is but to code and die.
    Into the bluescreen of death Wrote the six hundred.
  • (cs) in reply to cthulhu
    cthulhu:
    not not not FileNotFound. brilliant!

    etc

    something about my captcha being relevant at a stretch even though it isn't.

    etc

    Ok think I have covered it all. No need for you to post that "witty" comment now.

    I think you mean "Not no need for you not to post that not unwitty comment now."

  • (cs) in reply to Jim
    Jim:
    That line is an artifact of using grep an misdirecting the output into a file by mistake
    Why should it be a mistake? People often direct the output of grep to a file on purpose, like because they might want to refer to it later, or if they think there might be aa awful lot of output. These files are transient in nature and often named according to the passing whim of the programmer, or whatever's foremost in their mind at the time; hence they are often given names such as "wtf.txt", "crap.log", "fuckfuckfuck.txt", "aaaarrrrrrggghhhh.txt" or "iamgoingtoFUCKINGKILLMICROSOFT.txt". Presumably "why.txt" is shorthand for "whythefuckdoesittestthisvariableandicantevenfuckingfindanywhereitevergetssetoranysoddingreferencetoitatallFORCRYINGOUTLOUD!.txt"
  • Tuxie (unregistered)
    unless not !(contact_id != 0) !== !true
      return
    else
      process_cart
    end
    
  • Horamash (unregistered) in reply to halcyon1234
    halcyon1234:
    cthulhu:
    not not not FileNotFound. brilliant!

    etc

    something about my captcha being relevant at a stretch even though it isn't.

    etc

    Ok think I have covered it all. No need for you to post that "witty" comment now.

    I think you mean "Not no need for you not to post that not unwitty comment now."

    A nice example of Muphry's law there.

  • ath (unregistered)

    This is not a wtf. It's a koan written by a zen monk. In words: If something is not nothing, then there is nothing.

    My brain has sure reached Nirvana after reading it...

  • Qvasi (unregistered)

    Sometimes (like sombodys example above about !$inactive), it's more intuitive to have a "double negative" (I ain't not talking about no English double negatives, I mean logical: NOT NOT).

    But mentally parsing a series of NOT's is hard, that's why I really loved the ruby statement 'unless' wich is essentially an 'if not' but it somehow makes it less taxing on the brain. What I don't like so much about it is that you can't say:

    unless somecondition do
    #something
    else do
    #something else
    end
    Of course when you need both cases I should reverse it and use an if statement anywy.... but why not?

  • (cs) in reply to Zecc
    Zecc:
    I could ask the same thing.

    In recently found the following (formatted as is):

    if(somevar == 'some text') {} else {
        // code
    }

    I see that sort of thing all the time. Originally there was actually something to DO if there was 'some text' (not just if there wasn't) and then there wasn't anymore, and it was easier to just delete that logic and move on than to actually change the terms of the conditional.

  • (cs) in reply to Qvasi
    Why didn't they use some off-the-shelf ecommerce site? Why aren't there any comments, anywhere?? Why did anyone let the original developer near a keyboard, let alone allow him to program!? Why did I even bother coming in today!?!?
    1. Because it would have cost too much, done too much and the code probably wouldn't have been any easier to maintain and/or the maintenance costs would have been extortionate.

    2. Commented code doesn't make it good code, it just makes it commented.

    End Function // This is the end of the function.

    ^ I see that all the time. Good code should need very VERY sparse commenting, and only when there's a piece of specific business logic that could cause confusion should it be used, such as:

    // This is the default <<system>> rounding. return Convert.ToDecimal(Math.Round(Math.Abs(_investmentValue), 2, MidpointRounding.AwayFromZero));

    1. Because they didn't know any better and didn't review the code, this is more a problem with management and the development process than the coder (as usual).

    2. You came in today because they need you to fix the code. If the code worked and was easy to maintain, you'd be out of a job. You should be THANKING the original developer, not cursing them.

    As for TRWTF, was that line still in checkout.asp? Did he not realise it was grep output? TRWTF is that we didn't find out what TRWTF was.

  • (cs) in reply to Qvasi
    Qvasi:
    Sometimes (like sombodys example above about !$inactive), it's more intuitive to have a "double negative" (I ain't not talking about no English double negatives, I mean logical: NOT NOT).

    But mentally parsing a series of NOT's is hard, that's why I really loved the ruby statement 'unless' wich is essentially an 'if not' but it somehow makes it less taxing on the brain. What I don't like so much about it is that you can't say:

    unless somecondition do
    #something
    else do
    #something else
    end
    Of course when you need both cases I should reverse it and use an if statement anywy.... but why not?

    I'm not following. NOT NOT cancels itself out. Might as well say NOT NOT NOT NOT, or NOT NOT NOT NOT NOT NOT. It's all the same, and it all means "True" or "Yes" or "Equals" or whatever you're failing to negate. That's a basic rule of logic: you can add a double negative to any true proposition and not change its truth value at all.

    As for "unless", that's actually the sort of thing that makes me homicidal about Ruby. Over and over again they make the decision that it is easier to learn a special piece of syntax than to use a basic construction that exists in almost every programming language.

  • (cs)

    beyond the mind the answers wrought why "not why?" and not "why not?" a "geez" illogical find a carefully designed blind spot the file sheds light on oblivion's plot

  • SomeCoder (unregistered) in reply to Satanicpuppy
    Satanicpuppy:
    Qvasi:
    Sometimes (like sombodys example above about !$inactive), it's more intuitive to have a "double negative" (I ain't not talking about no English double negatives, I mean logical: NOT NOT).

    But mentally parsing a series of NOT's is hard, that's why I really loved the ruby statement 'unless' wich is essentially an 'if not' but it somehow makes it less taxing on the brain. What I don't like so much about it is that you can't say:

    unless somecondition do
    #something
    else do
    #something else
    end
    Of course when you need both cases I should reverse it and use an if statement anywy.... but why not?

    I'm not following. NOT NOT cancels itself out. Might as well say NOT NOT NOT NOT, or NOT NOT NOT NOT NOT NOT. It's all the same, and it all means "True" or "Yes" or "Equals" or whatever you're failing to negate. That's a basic rule of logic: you can add a double negative to any true proposition and not change its truth value at all.

    As for "unless", that's actually the sort of thing that makes me homicidal about Ruby. Over and over again they make the decision that it is easier to learn a special piece of syntax than to use a basic construction that exists in almost every programming language.

    You missed the point. It's not like saying:

    if (!!someCondition)

    He's saying:

    if (!inactive)

    That's essentially a double negative to humans which is pretty easy to parse.

    Also, if you can't understand unless... well it's not like the language forces you to use it. Just turn:

    unless ($inactive)

    into

    if (!$inactive)

    and voila.

  • (cs)

    I see Alex is still refusing to bury that horrible stillborn neologism of his. What was it, "develop me suction", or something dumb like that?

  • dividius (unregistered) in reply to Synchronos
    Synchronos:
    Aah, yes, I see it!

    The correct form would be: if isTrue(not contact_id <> 0) then

    Insufficiently Flexible. How about:

    if eqBoolean(not contact_id <> 0, TRUE)

    ?

  • iMalc (unregistered)

    Hrm, I've worked on contact-ID dialling and I don't not hate it!

  • (cs) in reply to Zylon
    Zylon:
    I see Alex is still refusing to bury that horrible stillborn neologism of his. What was it, "develop me suction", or something dumb like that?
    It's meant to be a combination of development, test, production - but it is truly awful, isn't it?
  • Logic (unregistered) in reply to DaveK
    DaveK:
    Jim:
    That line is an artifact of using grep an misdirecting the output into a file by mistake
    Why should it be a mistake? People often direct the output of grep to a file on purpose, like because they might want to refer to it later, or if they think there might be aa awful lot of output. These files are transient in nature and often named according to the passing whim of the programmer, or whatever's foremost in their mind at the time; hence they are often given names such as "wtf.txt", "crap.log", "fuckfuckfuck.txt", "aaaarrrrrrggghhhh.txt" or "iamgoingtoFUCKINGKILLMICROSOFT.txt". Presumably "why.txt" is shorthand for "whythefuckdoesittestthisvariableandicantevenfuckingfindanywhereitevergetssetoranysoddingreferencetoitatallFORCRYINGOUTLOUD!.txt"

    Indeed. I find nothing surprising (save perhaps the filename). Even that can probably be explained (other than the .txt bit - although this bloke may not be a UNIX natural). A frustrated programmer debugging might use all sorts of names for temporary files (and this is, after all what this was intended to be, one would think) - "Why" would be quite a natural filename to use when you are getting frustrated that you can't find why your program is misbehaving and you grep for (quite probably also) contact_id to see whether it is being modified elsewhere.

    Many people redirect output of grep to a file in case there is a lot - presumably person in question was seeing strange behaviour with the double negative, and was searching for the line to analyse it (and found it too, by the looks).

    The only WTF I can see is that someone found it was absolutely baffled by iut, submitted it to TDWTF and had it posted.....

    (Of course I may have missed something bleedingly obvious - like the double negative that that this poor chap missed, which clearly caused him {or her} all that grief....)

  • (cs) in reply to bitblit
    bitblit:
    beyond the mind the answers wrought why "not why?" and not "why not?" a "geez" illogical find a carefully designed blind spot the file sheds light on oblivion's plot

    Nice.

  • Petey (unregistered) in reply to Logic
    Logic:
    DaveK:
    Jim:
    That line is an artifact of using grep an misdirecting the output into a file by mistake
    Why should it be a mistake? People often direct the output of grep to a file on purpose, like because they might want to refer to it later, or if they think there might be aa awful lot of output. These files are transient in nature and often named according to the passing whim of the programmer, or whatever's foremost in their mind at the time; hence they are often given names such as "wtf.txt", "crap.log", "fuckfuckfuck.txt", "aaaarrrrrrggghhhh.txt" or "iamgoingtoFUCKINGKILLMICROSOFT.txt". Presumably "why.txt" is shorthand for "whythefuckdoesittestthisvariableandicantevenfuckingfindanywhereitevergetssetoranysoddingreferencetoitatallFORCRYINGOUTLOUD!.txt"

    Indeed. I find nothing surprising (save perhaps the filename). Even that can probably be explained (other than the .txt bit - although this bloke may not be a UNIX natural). A frustrated programmer debugging might use all sorts of names for temporary files (and this is, after all what this was intended to be, one would think) - "Why" would be quite a natural filename to use when you are getting frustrated that you can't find why your program is misbehaving and you grep for (quite probably also) contact_id to see whether it is being modified elsewhere.

    Many people redirect output of grep to a file in case there is a lot - presumably person in question was seeing strange behaviour with the double negative, and was searching for the line to analyse it (and found it too, by the looks).

    The only WTF I can see is that someone found it was absolutely baffled by iut, submitted it to TDWTF and had it posted.....

    (Of course I may have missed something bleedingly obvious - like the double negative that that this poor chap missed, which clearly caused him {or her} all that grief....)

    What's more, this file has highlighted the problem that presumably the submitter was looking for - the problem with contact_id can be found in the file

    /cart/checkout.asp
    at line 15.... I think the question 'why' has been quite successfully answered....

    I have to agree, the WTF is more with the submitter (and some of the people above :P ) I would say....

  • Or... (unregistered) in reply to luctus

    Why (!(not not))...!

  • poopdeville (unregistered) in reply to Satanicpuppy
    Satanicpuppy:
    Qvasi:
    Sometimes (like sombodys example above about !$inactive), it's more intuitive to have a "double negative" (I ain't not talking about no English double negatives, I mean logical: NOT NOT).

    But mentally parsing a series of NOT's is hard, that's why I really loved the ruby statement 'unless' wich is essentially an 'if not' but it somehow makes it less taxing on the brain. What I don't like so much about it is that you can't say:

    unless somecondition do
    #something
    else do
    #something else
    end
    Of course when you need both cases I should reverse it and use an if statement anywy.... but why not?

    I'm not following. NOT NOT cancels itself out. Might as well say NOT NOT NOT NOT, or NOT NOT NOT NOT NOT NOT. It's all the same, and it all means "True" or "Yes" or "Equals" or whatever you're failing to negate. That's a basic rule of logic: you can add a double negative to any true proposition and not change its truth value at all.

    Careful. It is usually true that double negatives "cancel out", but not always. The Howard-Curry isomorphism theorem shows that a computer program can be identified with a "constructive" proof. Double negatives being equivalent to the no-negative version of an expression is NOT in general true for a constructive proof, and specific cases must be proven as such.

    Back to slashdot with thee. ;-)

  • 50% Opacity (unregistered)

    "Well, uhh, I don’t know where he’s NOT. It wouldn’t be inaccurate to assume that I couldn’t exactly not say that it is or isn’t almost partially incorrect."

    "So you do know where he is?"

    "On the contrary. I possibly more or less not definitely rejected the idea in no way with any amount of uncertainty that I undeniably do or do not know where he shouldn’t probably be. If that indeed wasn’t where he isn’t. Even if he wasn’t where I knew he was…"

  • A Ex-Tutor (unregistered) in reply to 50% Opacity

    Ok, I know we should not make fun of students code, but I just have to share that line one of the students I tutored turned in:

    if (not_done != false)

    it actually took me a while to figure out what he tried to do.. then I took him aside and told him friendly to never ever do anything like this again.

Leave a comment on “Why Indeed”

Log In or post as a guest

Replying to comment #:

« Return to Article