109

Another piece of code that a guy in my office wrote. Now ex-employee!

Comments
  • 9
    What in holy hell.
  • 6
    At least put that if in two lines :-P
  • 24
    This.post.post.picture is a shame 😔
  • 0
  • 3
    Because "==" it's not a good enough check already
  • 0
    Dataception
  • 0
    I think the best thing about this is that I just found the code below that a coworker wrote. I'm glad to know someone else out there knows my pain.

    var checked = "0";
    if(function_name == "call_history")
    {
    if(document.getElementById("report").checked)
    {
    checked = "1";
    }
    }
  • 0
    This is one of the weirdest value safety
  • 1
    He was just programming defensively. :P
  • 0
    Was "debugger;" on production? Well..
  • 0
    Disgusting
  • 0
    Looks like this guy is grooming for management. Good.luck.luck.guy;
  • 1
    If this is java, strings should be compared with .equals , == actually wont do @7Raiden
  • 0
    @pepero It's Javascript.
  • 0
    @pepero True, I never coded in Java, but I remember that there's a 'triple equal' check? Maybe the usual '==' checks the pointers and "===" the actual content? Anyway, does that work also when you equal a string to a right reference (pardon my C++)? I mean, if that's the case "==" would never work!
  • 0
    Its javacript, and a shitty code.:-)
Add Comment