52

One of my colleagues at work has cooked up this amazing amazing method.. and guys brace yourself.. This code is on production..

Comments
  • 3
    I'm not good with Java, nor do I know what valuation functions should do... But...

    Why void/no return?
  • 4
    @BambuSource this method basically validates some results for you after you have performed some actions.. this is basically a piece of automated testing code.. just go through the logic this guy has applied for validating the results..
  • 0
    What is the best practice if you want to achieve somezhing like this?
  • 8
    @DjSall to use brackets
  • 3
    I take it the guy comes from Python background, am I right?
  • 5
    Even IDE is showing that this is wrong. How could he? 😂
  • 5
    @AndSoWeCode not only the brackets.. the logic too.. cant you guys just see it???
  • 4
    @rnair you know who he is.. 😂😂
  • 1
    @abhishekjavali well that's what I mean. Using brackets to delimit blocks of code, not indentation. Which leads to this dude creating a function that always fails the assertion, regardless of parameter values or any other stuff out there in the universe.
  • 3
    @rnair it would have been a boon if the IDE would have said its an error.. but its not.. the linter is like "I am not saying what you have done is entirely wrong but probably you are a dimwit moron"
  • 0
    @abhishekjavali now I see it. It makes me sad.
    Seems like even I could land a dev job if someone like this is allowed to be there.
  • 3
    @hash-table The whole purpose of assert equals is checking for equality. The guy is checking for equality himself (which too is incorrect) and then asking assert equals to validate his result.
  • 5
    @BambuSource just focus on 'check' variable
  • 0
    😂😂
  • 2
    So when IDs match he logs that they don't, and no matter what assertion will fail since check is always set to false O_O
    How did this reach production? How is it that this test never failed .-.
  • 1
    'check' is always false 😂😂😂
  • 1
    What the fuck. Why is that guy still alive. How few cells do you need in your brain to be able to manage that.

    Jesus fucking christ.

    It's like when people do:

    if (v == true) { return true; } else { return false; }
Add Comment