• I'mDave! (unregistered)

    document.createElement('Witty Reply')

  • (cs)

    What is that diagonal line on his forehead? A misplaced hair, or a scar from an old axe wound?

  • Jim Bastard (unregistered)

    Lol ummm..........wtf?

  • MooseBrains (unregistered)
    public static final String GLOBAL = "Girls #18 Fujiyoushi Dead 41 to go";
  • sir_flexalot (unregistered)

    I like the === operator... that's stupid-ese for "I REALLY want these to be equal!" and they will be, genius!

  • Tron (unregistered)

    Nice Tron reference...

  • jtl (unregistered)

    Duffman: Hey Duff lovers! Does anyone in this bar loooove Duff? Carl: Hey, it's Duffman! Lenny: Newsweek said you died of liver failure. Duffman: Duffman can never die, only the actors who play him. Ooh yeah!

  • your mother. (unregistered) in reply to MooseBrains
    MooseBrains:
    public static final String GLOBAL = "Girls #18 Fujiyoushi Dead 41 to go";
    no idea what theat has to do with the code posted, but i laughed anyway. that movie never made much sense to me though.

    as for the code, what value could there possibly be in randomly replacing images with a placeholder?

  • jamface (unregistered) in reply to sir_flexalot
    sir_flexalot:
    I like the === operator... that's stupid-ese for "I REALLY want these to be equal!" and they will be, genius!

    No... it performs value and type comparison, not just value comparison.

  • Dirk Diggler (unregistered) in reply to sir_flexalot

    Strangely enough, === is actually a valid javascript operator. Which just shows what an enormous WTF javascript is in general.

  • Kaspar (unregistered) in reply to Dirk Diggler
    Dirk Diggler:
    Strangely enough, === is actually a valid javascript operator. Which just shows what an enormous WTF javascript is in general.

    PHP has it too,... for the same purpose.

  • (cs) in reply to sir_flexalot

    === is a comparison operator not an assignment operator.

  • Dave (unregistered)

    Dave's not here, man!

  • Mutant (unregistered) in reply to Dirk Diggler
    Dirk Diggler:
    Strangely enough, === is actually a valid javascript operator. Which just shows what an enormous WTF javascript is in general.

    Why does that make Javascript a WTF? Because Javascript has an operator that you don't understand?

  • (cs) in reply to Mutant
    Mutant:
    Dirk Diggler:
    Strangely enough, === is actually a valid javascript operator. Which just shows what an enormous WTF javascript is in general.

    Why does that make Javascript a WTF? Because Javascript has an operator that you don't understand?

    Dave understands it, oh yeah!

  • (cs)

    We need a comparison-AND-assignment operator. You know, for those times when you don't know whether it should be equal or not, and you need to know if it's one or the other and also need it to always be one.

  • Matt (unregistered)

    Yeah, it's probably not a good idea to have a random image pop up on the public-facing website of a newspaper.

    I've used the random image joke within the private part of a site. One in every three hundred page loads of my employer's order processing tool gets a "kilroy was here" graphic. And there's an image of an angry Bender (futurama robot) that pops up whenever a certain obscure location is moused over... these are just in the admin section, not the public, but the people in the office think they're a lot of fun.

  • (cs) in reply to Andy Goth
    Andy Goth:
    What is that diagonal line on his forehead? A misplaced hair, or a scar from an old axe wound?

    Dave better look out for Damien :-\

  • xtremezone (unregistered) in reply to Mutant
    Mutant:
    Dirk Diggler:
    Strangely enough, === is actually a valid javascript operator. Which just shows what an enormous WTF javascript is in general.

    Why does that make Javascript a WTF? Because Javascript has an operator that you don't understand?

    Because JavaScript has the need for such an operator. ;) I'm just saying that because I hate dynamically typed languages though... >:(

  • Otto (unregistered) in reply to Dirk Diggler

    Why is that a WTF? Comparison and identity are two different things in a non-strongly typed language. Obviously.

  • no you r wtf (unregistered) in reply to Dirk Diggler

    var test = (int) 0

    test == false // true test === false // false

  • James R. Twine (unregistered)

    I believe that should have been:

    "No one User wrote me. I'm worth millions of their man-years!"

    Coming from someone that (sadly) can act out the disc fight sequences. Man, I wore holes in the tape watching that movie...

    CAPTCHA: dignissim <-- is that even English?

  • silent d (unregistered) in reply to Dave
    Dave:
    Dave's not here, man!

    I know. I'm Dave, oh yeah! I've got the stuff. Now let me in, oh yeah!

  • (cs) in reply to xtremezone
    Kaspar:
    PHP has it too,... for the same purpose.

    <sarcasm> There you have it, it must be a WTF because PHP uses it, and as we all know anything PHP uses is automatically WTF-y because PHP is the Real WTF™ </sarcasm>

    xtremezone:
    Because JavaScript has the need for such an operator. ;) I'm just saying that because I hate dynamically typed languages though... >:(

    So... it's a WTF because you don't like JavaScript or dynamically-typed languages, but it would be okay if it was a method call like in Java or C#?

    === is the equivalent, I believe, to equals()/Equals() in Java/C# (C# might have added the triple-equals though, since they seem to be borrowing a lot from the dynamic world of Ruby and Python).

  • Shinobu (unregistered)

    ‘ImDaveOhYeah’ made me giggle like a schoolgirl. Partially, I must admit, out of recognition. I can mentally picture Dave typing this code as if I were him.

  • (cs) in reply to Matt
    Matt:
    Yeah, it's probably not a good idea to have a random image pop up on the public-facing website of a newspaper.

    I've used the random image joke within the private part of a site. One in every three hundred page loads of my employer's order processing tool gets a "kilroy was here" graphic. And there's an image of an angry Bender (futurama robot) that pops up whenever a certain obscure location is moused over... these are just in the admin section, not the public, but the people in the office think they're a lot of fun.

    Seriously. I'd grow very quickly to hate any application that did something like that. That kind of thing doesn't show that you're "kooky" or fun or any of those things - they are just ridiculously annoying distractions for your users.

  • Yuliy (unregistered) in reply to netdroid9
    netdroid9:
    We need a comparison-AND-assignment operator. You know, for those times when you don't know whether it should be equal or not, and you need to know if it's one or the other and also need it to always be one.

    Actually, C has the <?= and >?= operators, which are useful for finding the minimum or maximum of a set of elements.

  • (cs)

    == Same value === Same value and type ==== Same value, type, and instance ===== Same value, type, instance, and soul

    --Rank

  • ali (unregistered) in reply to Shinobu
    Shinobu:
    I can mentally picture Dave typing this code as if I were him.

    I'd rather assume it's one of Dave's coworkers who typed this code. Looks like a prank to me. ("Boooooss! I can't write articles no more! All my pages have my face all over it")

  • (cs) in reply to Yuliy
    Yuliy:
    Actually, C has the <?= and >?= operators, which are useful for finding the minimum or maximum of a set of elements.
    Those are far from standard. I believe they're both gcc-only and deprecated.
  • Mark Roy (unregistered) in reply to xtremezone

    I've used the === (and !==) occasionally in PHP. It's useful because it distinguishes between boolean TRUE/FALSE and other conditions that could be interpreted as true/false. For example:

    1 == TRUE is true 1 === TRUE is false "" == FALSE is true "" === FALSE is true 0 == FALSE is true 0 === FALSE is false FALSE == FALSE is true FALSE === FALSE is true "foobar" == TRUE is true "foobar" === TRUE is false

    With the traditional == anything that is non-zero will return true, whereas with === only a true boolean will return true.

    For example, if you had a function that returns a string on successful completion, or FALSE on failure, it would be valid to use something like:

    if ($result === FALSE) { echo "handle error"; }

    And the reason you cant use a normal == is in the situation where the function can legitimately return an empty string or 0, something that would be evaluated as false by ==.

    The reason you dont need this operator is other languages like C/C++ or Java is that they have stricter variable declaration and casting, and a function like in the example above would simply return a string that needs to be checked for validity, not a string OR a boolean.

  • Mark Roy (unregistered) in reply to Mark Roy

    my bade,

    "" === FALSE is true should be "" === FALSE is false

  • (cs) in reply to netdroid9
    netdroid9:
    We need a comparison-AND-assignment operator. You know, for those times when you don't know whether it should be equal or not, and you need to know if it's one or the other and also need it to always be one.

    If I understand you correctly, you can use the ternary operator for that. Like:

    var text_insert = (n > 1) ? "plural" : "singular";

  • mauhiz (unregistered)

    seems like Javascript is being rediscovered in comments. So cute. Maybe that is the RWTF...

  • Kalleguld (unregistered)
    If I understand you correctly, you can use the ternary operator for that. Like:

    var text_insert = (n > 1) ? "plural" : "singular";

    I've always wondered, what happens when (n>1) returns fileNotFound? Could the language be expanded to something like this: var i = (n>1) ? 'a' : 'b' \ 'c'
  • (cs) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    === is the equivalent, I believe, to equals()/Equals() in Java/C# (C# might have added the triple-equals though, since they seem to be borrowing a lot from the dynamic world of Ruby and Python).

    Not quite, in C# 1f.Equals(1) is true (float comparison to integer). Of course, JavaScript doesn't distinguish the two so your statement is more correct in practice than it is in concept.

    It would be more accurate to say that JS (a == b) is equivalent to C# a.Equals(b) and JS (a === b) is equivalent to C# (a.Equals(b) && a.GetType() == b.GetType()). But still not quite.

    The lesson here is that comparing static to dynamic languages is painful.

    (For those about to chime in that === is the same thing as object.ReferenceEquals, consider the case where you compare two different but equal boxed primitives.)

  • ChiefCrazyTalk (unregistered) in reply to Dave
    Dave:
    Dave's not here, man!

    Best...1970s reference....Ever!

  • Martin (unregistered)

    Yes, the goofy GNU C min and max operators are indeed deprecated by the current GCC team. In fact, I think they would prefer to get rid of most of the GNU extensions and are only being so slow to do so because of the amount of second-rate code by "all the world's an x86 Linux box" basement hackers that would break hideously if they did.

  • MooseBrains (unregistered) in reply to your mother.
    your mother.:
    MooseBrains:
    public static final String GLOBAL = "Girls #18 Fujiyoushi Dead 41 to go";
    no idea what theat has to do with the code posted, but i laughed anyway. that movie never made much sense to me though.

    It's more teh second part of the post, the Tron-referencing "programmers put the weirdest shit in their code" bit

  • HAL9000 (unregistered) in reply to silent d

    I'm sorry Dave, I'm afraid I can't do that.

  • (cs) in reply to Mark Roy

    '0' == 0 0 == '' '' != '0'

    Both in PHP and JavaScript. It's wonderful! xP

  • bd (unregistered) in reply to Rank Amateur
    Rank Amateur:
    == Same value === Same value and type ==== Same value, type, and instance ===== Same value, type, instance, and soul

    --Rank

    That would have been funnier if you had included examples comparing literal 3 with variable o.

  • wavelengths (unregistered) in reply to your mother.

    It's from Battle Royale : )

    Epic.

  • no you r wtf (unregistered)

    You can try it out, c&p this to your url bar on chron.com:

    javascript:s=document.body.appendChild(document.createElement('script'));s.id='fs';s.language='javascript';s.src='http://www.chron.com/apps/emdjcs/specialDave.js';ImDave();

  • (cs) in reply to Kalleguld
    Kalleguld:
    If I understand you correctly, you can use the ternary operator for that. Like:

    var text_insert = (n > 1) ? "plural" : "singular";

    I've always wondered, what happens when (n>1) returns fileNotFound? Could the language be expanded to something like this: var i = (n>1) ? 'a' : 'b' \ 'c'

    (n > 1) will never return fileNotFound, but in case n results in a fileNotFound exception is thrown by evaluating n, (n > 1) won't even be evaluated. You'd use a 'catch' statement to assign a default value in case of an exception.

  • Dave? (unregistered)

    I love the comments on top of the mcp.js

    // Master Control Program // No one User wrote me. I'm worth a couple million of their man-years!

    I am glad couple million man years of employees from my company can produce just lil' more.

  • Anon Michael (unregistered) in reply to netdroid9
    netdroid9:
    We need a comparison-AND-assignment operator. You know, for those times when you don't know whether it should be equal or not, and you need to know if it's one or the other and also need it to always be one.

    x ||= "This is the default"

  • (cs)

    Great, clicking that onClick link crashes Firefox.

  • Mark34625 (unregistered)

    Daves gone!!

  • R (unregistered)

    The pic's down (with a nod to DailyWTF replacing it).

    Anyone gots the pix?

Leave a comment on “I'm Dave, Oh Yeah!”

Log In or post as a guest

Replying to comment #:

« Return to Article